Jump to content

Archived

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

cturner

Rows aren't displaying from the query???

Recommended Posts

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.

[code]
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'];
}
[/code]

Share this post


Link to post
Share on other sites

×

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.