Hello all,
I'm trying to run a series of database SQL update statements utilizing a text file read in via PHP. I can get the lines to print out on the web browser but it does not seem to execute my update statement. Here is my code:
Can anyone tell me what's going on? It seems simple to me but just doesn't want to work.
Thanks,
Jisoo23
I'm trying to run a series of database SQL update statements utilizing a text file read in via PHP. I can get the lines to print out on the web browser but it does not seem to execute my update statement. Here is my code:
Code:
$lines = file('newlist.txt');
foreach ($lines as $line){
$update = pg_query($conn, "UPDATE table1 SET field1 = 't' WHERE field2 = '$line'");
}
Can anyone tell me what's going on? It seems simple to me but just doesn't want to work.
Thanks,
Jisoo23