Problem in using Prepare in PHP adodb
Posted: Wed Nov 02, 2011 8:50 pm
Good day Guys,
I encountered problem when I used PREPARE function.
This is my sample code:
Error Message:
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> ADODB.Connection<br/><b>Description:</b> Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
I have already check the number of ??? in the Insert function and also the adodb library.
Your advice is very much welcome.
Thanks
I encountered problem when I used PREPARE function.
This is my sample code:
Code: Select all
<?php
$myServer = "NMDSU_00";
$myUser = "sa";
$myPass = "123456Aa";
$myDB = "examples";
//create an instance of the ADO connection object
$conn = new COM ("ADODB.Connection")
or die("Cannot start ADO");
//define connection string, specify database driver
$connStr = "PROVIDER=SQLOLEDB;SERVER=".$myServer.";UID=".$myUser.";PWD=".$myPass.";DATABASE=".$myDB;
$conn->open($connStr); //Open the connection to the database
$sqlInsert = $conn->Prepare('Insert into Cars values(?,?,?)');
$conn->Execute($sqlinsert(5,'Nissan','2000'));
?>Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> ADODB.Connection<br/><b>Description:</b> Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
I have already check the number of ??? in the Insert function and also the adodb library.
Your advice is very much welcome.
Thanks