Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- $pdo->prepare($sql) with "?"
September 15, 2008, 10:14 am
rate this thread
Could you please help me:
$sql = "SELECT qualityId FROM quality WHERE qualityName = 'VVS'";
$r = $d->selectQueryQuality($sql);
$sql = "INSERT INTO stones (size, price, qualityId) VALUES(?,?,$r)";
$c->insertMySQL($sql, 9, 14, 3, 18, $check );
As you see in the 3rd statement, I'm trying to use instead of the 3rd
question mark a variable, but this gives me an error: Could not
prepare query: INSERT INTO stones (size, price, qualityId)
The error shows that at the last position there's no ? (of course),
but also no value.
How can I make that the value shows up there and how can I make that I
can execute the $pdo->prepare if in one place there's a value instead
Thanks a lot for your help.
- Janwillem Borleffs
September 15, 2008, 3:33 pm
- » script to help booking of holliday home in a web site
- — Previous thread in » PHP Scripting Forum