| View previous topic :: View next topic |
| Author |
Message |
soladon13
Joined: 08 Aug 2007 Posts: 4
|
Posted: Sun Jul 13, 2008 11:12 pm Post subject: MDB2 and User-Define MySQL Variables |
|
|
Hello,
I really need some help here.
I am running the following:
<?php
require_once('MDB2.php');
$dsn = 'mysqli://username:password@localhost/';
$db =& MDB2::singleton($dsn);
$prep =& $db->prepare('SELECT @x:=5');
$res = $prep->execute();
if (MDB2::isError($res)) {
echo "Error.\n";
echo $res->message . "\n";
echo $res->userinfo . "\n";
}
?>
but I am getting the following error:
"Error. MDB2 Error: not found [Error message: Unable to bind to missing placeholder: SELECT @x:=5] "
Is there another way to set a variable?
Any ideas for a fix?
Thank you |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1003
|
|
| Back to top |
|
 |
soladon13
Joined: 08 Aug 2007 Posts: 4
|
Posted: Tue Jul 15, 2008 1:00 am Post subject: |
|
|
Thank you for your reply.
I used exec($sql) (since I wanted an insert ON DUPLICATE update) and it works fine. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|