I'm having trouble executing queries using odbc. Here's what I use:
define("NEED_REPLY", true);
$con = 0;
function con()
{
$con = odbc_connect("rest","DBA","SQL");
odbc_autocommit($con, true);
}
function query($query, $reply_expected = false)
{
$reply = odbc_exec($con, $query);
if ($reply_expected == true)
return $reply;
}
$query = "select * from user";
$result = query($query, NEED_REPLY);
while ($row = odbc_fetch_array($result))
{
echo "<REPLY>".$row["username"]."</REPLY>";
}
I get:
Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in
c:\inetpub\wwwroot\HakayaFiles\sybase.php on line 13
Warning: odbc_fetch_array(): supplied argument is not a valid ODBC result resource in
c:\inetpub\wwwroot\HakayaFiles\query.php on line 7
Please HELP!
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.