RE: Resource id ... what is this?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

You are trying to display the link to the query rather than results
themselves.


$query = 'SELECT *  FROM table  WHERE field="some condition"';
$mysql_result = mysql_query($query, $link);

$retval.='<table width="95%">';

while($row = mysql_fetch_array($mysql_result))
{// enter display code here
$retval.='<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></
tr>';
$retval.='<tr><td>'.$row[""].'&nbsp;</td><td>'.$row["some_field"].'&nbsp;</t
d><td>
'.$row["some_other_field"].'&nbsp;</td><td>&nbsp;</td></tr>';
$retval.='<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></
tr>';

}// end while

$retval.='</table>';

print $retval ;

you are probably doing

$query = 'SELECT *  FROM table  WHERE field="some condition"';
$mysql_result = mysql_query($query, $link);

print $mysql_result ;
(which prints the resource ID)


If this doesn't help come back to me.

PS Better to post code rather than just a discription of the problem

HTH

Peter



-----Original Message-----
From: Kenneth Wright [mailto:kenwright@orange.net]
Sent: 24 May 2003 13:42
To: php-db@lists.php.net
Subject:  Resource id ... what is this?


Dear Group,

I am trying to do a simple HTML/PHP database query against a MySql database.
When I run the query in the monitor and in PHPMyAdmin .... I get exactly the
response I am looking for. When I run in through Apache1.3+/PHP4+ on Windows
2000, I get a response "Resource id #" with the number 3 or 11 or whatever
against the #. My calls pass all my tests ..... The connection to the
database is OK ... the password, table, localhost, user etc etc tests are
all OK, but all I get back is this string "Resource id #3" or whatever
number. I have tried rewriting the code many times following many textbook
suggestions ... but still the same result.

Anybody got any ideas where I am going wrong.

Thanks
Ken



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux