Jump to content

[SOLVED] How to return a mysql result set


ryy705

Recommended Posts

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 :D.

 

 

Link to comment
https://forums.phpfreaks.com/topic/108713-solved-how-to-return-a-mysql-result-set/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.