Entering edit mode
6.0 years ago
nemo
▴
40
I would like to add rows to my table in PostGresql. I wrote the following code:
$M = array("H","HS","P");
$dbconn = pg_Connect(pg_Connect("localhost", "5432", "", "", "test");
foreach ($M as $Match){
$query = "INSERT INTO table_name ("ID","SP","Match") VALUES ("A","Human",$Match);
$query = pg_query($query);
}
pg_Close($dbconn);
I got as error "query fails". Could someone tell me what I am doing wrong?