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
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.