Jump to content

My Script Is Pulling Some Wierd Info...


AbydosGater

Recommended Posts

Hello,
My script is as follows...

[code]
<?php
mysql_connect("localhost", "stargate_admin", "") or die(mysql_error());
mysql_select_db("stargate_abydosgaters") or die(mysql_error());

$welcome = mysql_query("SELECT * FROM config
WHERE id='1'") or die(mysql_error());

?>
[/code]

Ok,
and in my database,
We have two tables id, and welcome message,
but if you go to www.abydosgaters.com

in the marquee at the top, there is this weird "Resource Id #6"

Why am i getting this and not my welcome message?  

Link to comment
https://forums.phpfreaks.com/topic/7033-my-script-is-pulling-some-wierd-info/
Share on other sites

mysql_query does NOT return the answer you are looking for. It returns a resource that contains lots of information about the query.

To get a row of data out of the resource, you use a fetch function like mysql_fetch_array(). To get the second row, you use mysql_fetch_array() again. The third, again. Or you put it at the top of a loop.

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.