Scotty13 Posted June 1, 2011 Report Share Posted June 1, 2011 this is my script.... <?php // connect to your MySQL database here require_once "connect_to_mysql.php"; // Build the sql command string $sqlCommand = ("SELECT * FROM myMembers ORDER BY dateField DESC LIMIT 6"); // Execute the query here now $query = mysql_query($sqlCommand) or die (mysql_error()); // Output the data here using a while loop, the loop will return all members while ($row = mysql_fetch_array($query)) { // Gather all $row values into local variables for easier usage in output $id = $row["id"]; $firstname = $row["firstname"]; $lastname = $row["lastname"]; $country = $row["country"]; // echo the output to browser echo "Item ID = $id <br />Item firstname = $firstname <br />Item lastname = $lastname <br />Item country = $country <hr />"; } // Free the result set if it is large mysql_free_result($query); // close mysql connection mysql_close(); ?> When I test it in my browser, I get this error message... Unknown column 'dateField' in 'order clause' Please Help & Thanks in Advance, Scotty13 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.