|
|
|||||||
Hello all When I try to use the code listed below I get an 'Expected Expression' error on the DBGetRecordSet line. Any help is appreciated. Thanks in advance Kevin $dsn = "DRIVER=MySQL;SERVER=School;UID=root;PWD=;DATABASE=Internet" $connection=DBConnOpen($dsn) $YOI = SubStr( @UserID ,2 , 2) $UserID = SubStr( @UserID , 4 , 4) $recordset = DBGetRecordset($connection,"SELECT Internet FROM Access WHERE YOI='$YOI' AND USERID='$USERID'") $retcode = DBConnClose($dsn) |
||||||||
|
|
|||||||
Check the returned error codes, as it is possible that the DBConnOpen did not suceed. Is a MySQL ODBC driver installed? Also, rather use code:as it is recommended to not have vars in strings."SELECT Internet FROM Access WHERE YOI='"+$YOI+"' AND USERID='"+$USERID+"'" Or try a simple SQL statement like "SELECT * FROM Access". [ 22. June 2003, 22:36: Message edited by: sealeopard ] |
||||||||
|
|
|||||||
Hello Sealeopard Thanks for the reply. I think your solution to do with the variables may fix the problem as when I replace the variables with fixed data the code works correctly. Bye for now Kevin |
||||||||
|
|
|||||||
SQL Statemenst are rather finicky with regards to the use of quotes. I always put a SQL statement into a variable before feeding it into the UDF. |