Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //By Garry Priambudi
- //Website: garrystudio.com
- function db_insert_array($tbl, $arr) {
- $sql = "INSERT INTO $tbl ";
- $sql .= "VALUES(";
- $arrLength = count($arr);
- $no = 0;
- foreach ($arr as $val) {
- $no += 1;
- if ($no >= $arrLength) {
- $sql .= "'$val'";
- }else {
- $sql .= "'$val',";
- }
- }
- $sql .= ")";
- return $sql;
- }
Advertisement
Add Comment
Please, Sign In to add comment