hunge — 2013-01-18T10:44:52-05:00 — #1
I got this Fatal error: Call to a member function bindValue() on a non-object in c:\wamp\www\addjoke\index.php on line 51.
What does it mean and how to fix it? Below is the code teached by book, after i execute it, the browser gave me fatal error on bindValue.
Any opinion will be appreciate.
$sql='INSERT INTO joke SET
joketext = :joketext,
jokedate = CURDATE()';
$error='Error adding submitted joke: ' . $e->getMessage();
header ('Location: .');
starlion — 2013-01-18T10:49:02-05:00 — #2
Think you'll find your answer a bit more subtle..
s != S
Your error message tells you that $s doesnt have a 'bindValue' method. And it doesnt, because $s is undefined. $S is defined, as an object type PDOStatement. $S has a method bindValue....
hunge — 2013-01-18T12:44:41-05:00 — #3
Thanks your help, really appreciate it. I think i overlooked it for 2 days, keep finding the mistake...haha! Thank you very much! Now, it's working!