error message when preparing and executing an odbc_exec() in php3
| From: | Conover, Ryan | Date: | Fri, 07 Jul 2000 17:23:42 +0000 |
| Subject: | error message when preparing and executing an odbc_exec() in php3 | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-956@lists.php.net to get a copy of this message | ||
I keep getting the following error message.
Warning: SQL error: [OpenLink][ODBC][Microsoft][ODBC SQL Server Driver][SQL
Server]Statement(s) could not be prepared., SQL state S1000 in SQLExecDirect
in /Intranet/projs/jobsearch.php on line 41
statement was executed
Here is my code.
<?php
putenv("LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib");
putenv("ODBCINSTINI=/usr/local/openlink/bin/odbcinst.ini");
putenv("ODBCINI=/usr/local/openlink/bin/odbc.ini");
$dsn="DSN=Joblist";
$user="Inetadmin";
$password="Inetadmin";
if ($conn_id=odbc_connect("$dsn","$user","$password")){
$query="SELECT From Joblist WHERE JOB_NO = $number";
$work=odbc_exec($conn_id,$query);
if($work="true"){
echo("statement was executed");
}
else{
echo("did not work");
}
}
else{
echo ("A connection to the database could not be made please try again");
}
?>
If anyone has any ideas why let me know.
Ryan