i5_query() Error

General discussion on Zend Studio for IBM System i
Post Reply
chczendphp
Posts: 5
Joined: Tue Feb 02, 2010 10:31 pm

i5_query() Error

Post by chczendphp » Fri Feb 19, 2010 7:46 pm

I am attempting to run the following query/sql:

Code: Select all

$sel_query = i5_query("SELECT DISTINCT fielda FROM file1 GROUP BY fielda ORDER BY fielda")
I coded the PHP page to spit out the error values for each query. Here is the error I am getting:

Code: Select all

Error code: 262 Error message: Parameter 1 must be a ressource but a null was passed array(8) { [0]=> int(262) [1]=> int(9) [2]=> string(54) "Parameter 1 must be a ressource but a null was passed " [3]=> string(0) "" ["num"]=> int(262) ["cat"]=> int(9) ["msg"]=> string(54) "Parameter 1 must be a ressource but a null was passed " ["desc"]=> string(0) "" } 
When I added the connection var to the query statement, I get the same error. This query is designed to return distinct values for a specific field in a file so that I can load a SELECT tag.

Also, is there a way to test the SQL statement coded in the PHP page through Zend Studio? I ask this question because on an i5 you can use the word DESCEND but Zend doesn't like that. You have to use DESC.

Post Reply