Jump to content

Archived

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

AbydosGater

My Script Is Pulling Some Wierd Info...

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?  

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.