Answers for "how to insert into an arrayt"

PHP
1

number insert in the array

int x[6];
int n=123456;
int i=0;
while(n>0){
   x[i]=n%10;
   n=n/10;
   i++;
}
Posted by: Guest on June-08-2021
0

insert array

protected function build_sql_insert($table, $data) {
    $key = array_keys($data);
    $val = array_values($data);
    $sql = "INSERT INTO $table (" . implode(', ', $key) . ") "
         . "VALUES ('" . implode("', '", $val) . "')";
    return($sql);
}
Posted by: Guest on October-11-2021

Code answers related to "how to insert into an arrayt"

Browse Popular Code Answers by Language