Jump to content


Photo

Rows aren't displaying from the query???


  • Please log in to reply
1 reply to this topic

#1 cturner

cturner
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • LocationMy computer

Posted 24 October 2006 - 09:01 PM

When I test the following code the rows ($row['date'] and $row['diary_entry']) don't display. Can someone please tell me why and how I can fix it? Thanks in advance.

require "config.php";

// get the entry date
$entry_date = $_GET['entry_date'];
$date = date("j F Y", $entry_date);

// select the diary entry for the entry_date
$query = mysql_query("SELECT * FROM `diary_contents` WHERE `date` = '$date' LIMIT 1") or die ("Could not query because: ".mysql_error());

// display the diary entries for the entry date
// display the selected date
echo "Posted on: ".$date;

// display the selected diary entry
while($row = mysql_fetch_array($query)){
    // Build your formatted results here.
	echo $row['date'];
    echo $row['diary_entry'];
}


#2 cturner

cturner
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • LocationMy computer

Posted 24 October 2006 - 09:04 PM

Sorry I have solved the problem.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users