Jump to content

query not grabbing :/


aebstract

Recommended Posts

$query = mysql_query("SELECT * FROM news WHERE id = '1'") or DIE(mysql_error());
	      if(mysql_num_rows($query)==0){

	while($r=mysql_fetch_array($query))
	{
	echo "working";
	}

		  } else {
		  echo "too bad";
		  }

 

I keep getting "too bad" returned and I don't see anything wrong with my query? I tried doing just SELECT * FROM news and that didn't work so I tried to be more specific, still no sauce. Is news a predefined variable or something and I can't use it?

Link to comment
https://forums.phpfreaks.com/topic/192815-query-not-grabbing/
Share on other sites

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.