I need to convert an array into an SQL query string to fill a DB

  php, sql

I have this in my PHP code:

$worker[] = array(id => 1, name => "John", cognome => "Doe");
$worker[] = array(id => 2, name => "Mark", cognome => "White");
$worker[] = array(id => 3, name => "Lucian", cognome => "Pillow");

I need to insert these in a DB creating a function that returns an SQL query into a string.

How can I do it?

Source: Ask PHP

LEAVE A COMMENT