Jump to content


Photo

My Script Is Pulling Some Wierd Info...


  • Please log in to reply
1 reply to this topic

#1 AbydosGater

AbydosGater
  • Members
  • PipPipPip
  • Advanced Member
  • 435 posts
  • LocationAlways at computer!

Posted 10 April 2006 - 03:50 PM

Hello,
My script is as follows...

<?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()); 

?>

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?  


www.abydosgaters.com

Current Project: Blog Application.. Undecided name.. Status: Coming along great.

#2 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 10 April 2006 - 04:47 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users