PDA

View Full Version : ODBC / MsAccess / php



eksob
01-03-2006, 08:19 PM
I am having trouble retreiving a field that has a space

Warning: odbc_result(): supplied argument is not a valid ODBC result resource

example:



while(odbc_fetch_row($table)){

$status = odbc_result($table, "status");
$date = odbc_result($table, "Date");
$origpn = odbc_result($table, "Part Number");



this being the problem


$origpn = odbc_result($table, "Part Number");


Any suggestions? It is not an option to change the field name.

Prikid
01-04-2006, 12:42 AM
Taken from PHP.net commentary (http://www.php.net/odbc_result)



spooky
14-Mar-2003 12:27
It took me a while to find out why there was a problem with retrieving data with odbc_result statement.

Warning: SQL error: [Microsoft][ODBC SQL Server Driver]
SQL state S1002 in SQLGetData

State S1002 means that invalid column index has been used.
I checked it hundred times - column index was OK.

Finally i ordered calls of odbc_result statement according to order of fields in the table. It helped.

Best regards


see if that will help you