ckrudelux Posted February 18, 2009 Share Posted February 18, 2009 $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 More sharing options...
boen_robot Posted February 18, 2009 Share Posted February 18, 2009 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 More sharing options...
ckrudelux Posted February 18, 2009 Author Share Posted February 18, 2009 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 More sharing options...
ckrudelux Posted February 18, 2009 Author Share Posted February 18, 2009 okay then I take away country I get my data form my database does what mean that you can't use Two "and" in the code? and if what should I write then? Link to comment Share on other sites More sharing options...
jeffman Posted February 18, 2009 Share Posted February 18, 2009 $category = $_GET['category']; $cuntry = $_GET['country'];***. . . WHERE country='$country' . . . Maybe because you used two different spellings of $country?BTW, multiple AND clauses are OK. Link to comment Share on other sites More sharing options...
ckrudelux Posted February 18, 2009 Author Share Posted February 18, 2009 Maybe because you used two different spellings of $country?BTW, multiple AND clauses are OK.Thanks bad typing is allways irritating Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.