Re: [PHP-DB] odbc errors
P.S. One of the users there mentions that she had to open the odbc_free_result INTO a variable in order for it to work: $free_result = odbc_free_result($sql_result); for example Angie >>> "Jello" <[EMAIL PROTECTED]> 05/15/01 10:27AM >>> i've just upgraded my computer... running win ME ( i know), PWS and PHP 4.0.5 and access 2000 (odbc) ... the same set up as my last one... i keep getting error msg from scripts that worked only last week on the old setup... the DB is ok as it will connect prepare and execute with no error... but then i get the following msg's Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 18 which is odbc_result_all($sql_result,"border=1"); nothing to fancy there and the same message Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 21 which is odbc_free_result ($sql_result); again just a basic action... nothing fancy it's strange as all the other bits of the scripts work with no problems so i think its the ODBC set up. but that is where i step out of the light in to a very dark room and it's driving me nuts...any help or pointers would be cool... MTIA Jello a copy of the whole script is below -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] odbc errors
Jello, You may want to look at some of the user comments on odbc_result_all manual on php.net: http://www.php.net/manual/en/function.odbc-result-all.php Some people mentions errors and fixes there for your problem. I think you are getting connected or you would have got your error messages "Couldn't connect" or "Couldn't execute". That error you are getting is a failure to recognize the function and it's parameters, NOT that you aren't connected. Angie >>> "Jello" <[EMAIL PROTECTED]> 05/15/01 10:27AM >>> i've just upgraded my computer... running win ME ( i know), PWS and PHP 4.0.5 and access 2000 (odbc) ... the same set up as my last one... i keep getting error msg from scripts that worked only last week on the old setup... the DB is ok as it will connect prepare and execute with no error... but then i get the following msg's Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 18 which is odbc_result_all($sql_result,"border=1"); nothing to fancy there and the same message Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 21 which is odbc_free_result ($sql_result); again just a basic action... nothing fancy it's strange as all the other bits of the scripts work with no problems so i think its the ODBC set up. but that is where i step out of the light in to a very dark room and it's driving me nuts...any help or pointers would be cool... MTIA Jello a copy of the whole script is below -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] odbc errors
Jello, It appears that your odbc_connect is not happening :) Can you post your code? Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Jello [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 11:27 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] odbc errors > > > i've just upgraded my computer... running win ME ( i know), PWS and PHP > 4.0.5 and access 2000 (odbc) ... the same set up as my last > one... i keep > getting error msg from scripts that worked only last week on the old > setup... > the DB is ok as it will connect prepare and execute with no error... but > then i get the following msg's > > > Warning: Supplied argument is not a valid ODBC result resource in > \include\db1.txt on line 18 > > which is > odbc_result_all($sql_result,"border=1"); > nothing to fancy there > > and the same message > Warning: Supplied argument is not a valid ODBC result resource in > \include\db1.txt on line 21 > > which is > odbc_free_result ($sql_result); > again just a basic action... nothing fancy > > > it's strange as all the other bits of the scripts work with no > problems so i > think its the ODBC set up. but that is where i step out of the > light in to a > very dark room and it's driving me nuts...any help or pointers would be > cool... > > MTIA > Jello > > a copy of the whole script is below > > > > // connect to system dsn odbc name login and password or die > $connect = odbc_connect("db1","login","pword") or die (" not connected"); > > // create SQL statement > $sql = "SELECT id,code,matchcode FROM products "; > > > // prepare SQL statement > $sql_prepare = odbc_prepare($connect,$sql) or die("Couldn't prepare > query."); > > // execute SQL statement and get results > $sql_result = odbc_execute($sql_prepare) or die("Couldn't execute > statement."); > > > // echo the result in a nice table > odbc_result_all($sql_result,"border=1"); > > // free up resources > odbc_free_result ($sql_result); > > // close connection > odbc_close($connect); > > > > ?> > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] odbc errors
i've just upgraded my computer... running win ME ( i know), PWS and PHP 4.0.5 and access 2000 (odbc) ... the same set up as my last one... i keep getting error msg from scripts that worked only last week on the old setup... the DB is ok as it will connect prepare and execute with no error... but then i get the following msg's Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 18 which is odbc_result_all($sql_result,"border=1"); nothing to fancy there and the same message Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 21 which is odbc_free_result ($sql_result); again just a basic action... nothing fancy it's strange as all the other bits of the scripts work with no problems so i think its the ODBC set up. but that is where i step out of the light in to a very dark room and it's driving me nuts...any help or pointers would be cool... MTIA Jello a copy of the whole script is below -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]