Jump to content

Help With Sql To Php


ckrudelux

Recommended Posts

$category = $_GET['category'];	$cuntry = $_GET['country'];						mysql_pconnect('localhost', 'root', '') or die("Can not connect");						mysql_select_db("yournews");	$query = mysql_query("SELECT * FROM articles WHERE country='$country' and category='$category' and type='article' ORDER BY article_id DESC");						while($row = mysql_fetch_assoc($query))	{?><div>	<p><?php echo $row['user']; ?><?php echo $row['article']; ?></p></div><?php}

I guess my problem is what I missed something, I get noting from my database but I should.. I think what I can't write these where I did " $country $category "

Link to comment
Share on other sites

How does your DB look? What do you mean by "nothing"? Do you get a <p> element with no content in it, or do you not get even that? What kinds of input are you giving to the PHP?

Link to comment
Share on other sites

How does your DB look? What do you mean by "nothing"? Do you get a <p> element with no content in it, or do you not get even that? What kinds of input are you giving to the PHP?
Notice: Undefined variable: country in C:\wamp\www\yournews2.0\index.php on line 99 and the <p></p> does not exist in the ctrl+u window in firefox/opera
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...