ryy705 Posted June 4, 2008 Share Posted June 4, 2008 Hello, Hello, mysq_query($query) returns a valid result set. However, calling my custom function query() returns a 1. For example: <?php include('connection.php'); $query = "select field from table where field='f1'"; echo mysql_query($query); echo query($query); function query($sql) { return mysql_query($sql); } ?> mysql_query() will echo resouce id #7 and query() will echo 1. I can't Figure out why. Does any know how to pass a mysql result set? Many thanks in advance . Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 4, 2008 Share Posted June 4, 2008 Is that the exact code you are using? Both return a result resource for me. Quote Link to comment Share on other sites More sharing options...
ryy705 Posted June 4, 2008 Author Share Posted June 4, 2008 Thanks for your reply, I just changed the name of the field and the name of the table. Do you suppose it has something to do with the php installation settings? Quote Link to comment Share on other sites More sharing options...
ryy705 Posted June 4, 2008 Author Share Posted June 4, 2008 Found the problem. I had or die('Query failed. ' . mysql_error()) tacked on the function thats why it wasn't working. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.