Hello everyone! I'm new here on phpfreaks - Here's my problem. I get "1 <br/> 2" echoed, but not the query results. the connect() function connects and selects a table in a mysql database.
Here's the code:
<?php
connect();
$query = "SELECT `title`, `body`, `date` FROM `tutorials` ORDER BY `date` DESC" or die ("Query Error");
$counter = 0;
if ($query_run = mysql_query($query)) {
while ($query_row = mysql_fetch_assoc($query_run)) && ($counter <= 2) {
$title = $query_row['title'];
$body = $query_row['body'];
$date = $query_row['date'];
$counter ++;
echo $counter;
echo "<br/>";
echo $title;
echo $body;
echo $date;
}
}
?>
If anyone has any idea, please help! - I'm been battling this for a few hours now