can't return query using ODBC

wxdqz

New Member
+----------------+
here is my code:
+----------------+

// check to see if record already exists
$connection = odbc_connect ("acctmgr", "", "");

// print connection value
print ("<p>connect_id: $connection</p>");

// create query
$query = "SELECT url FROM acctmgr WHERE url LIKE '$url'";

// echo query
print ("<p>$query</p>");

// run query
$result = odbc_do ($connection, $query);

// print query result value
print ("<p>result_id: $result</p>");

// find number of records found
$number = odbc_num_rows ($result);

// print number of records found
print ("<p>number of rows: $number</p>");

+----------------------------+
here is the result of my code
+----------------------------+
connect_id: Resource id #1

SELECT url FROM acctmgr WHERE url LIKE 'www.yahoo.com'

result_id: Resource id #2

number of rows: -1


+------------------------+
thank you for your help
+------------------------+
 
Back
Top