View Full Version : UPDATE statement not working!
aleksgurl
11-05-03, 04:52 PM
It'll be greatly appreciated if someone could tell me why this statement doesn't work..
$query = $db_handle->prepare("UPDATE courseappform SET provider = '$provider' WHERE sessionid = ?");
$query->execute($sessionid);
$query->finish;
I don't see any syntax error, i think this command is perfectly fine, however it doesn't work.
Millennium
11-06-03, 02:57 AM
It'll be greatly appreciated if someone could tell me why this statement doesn't work..
$query = $db_handle->prepare("UPDATE courseappform SET provider = '$provider' WHERE sessionid = ?");
$query->execute($sessionid);
$query->finish;
I don't see any syntax error, i think this command is perfectly fine, however it doesn't work.
did you try it like this:
provider = $provider
(no single quotes)
hyjacked
11-06-03, 07:35 AM
the above or if that don't work then maybe take the $provider part right out of the "".
I'm not totally sure how perl works but other languages I've done it usually went
"..." & variable & "..."
makro77
11-06-03, 08:17 AM
Send Us The Error Message!
aleksgurl
11-06-03, 10:35 AM
There was no error message unfortunately.. maybe it's because i didn't put a die statement.
I really don't understand what's wrong, I'm using postgreSQL as my database server.
Maybe the syntax is not right for postgreSQL?
Try setting RaiseError when you connect or die'ing with $DBI::errstr.
Here is info on RaiseError:
http://search.cpan.org/~timb/DBI-1.38/DBI.pm#Outline_Usage
-or-
http://search.cpan.org/~timb/DBI-1.38/DBI.pm#RaiseError
~Charlie
vBulletin® v3.6.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.