Scotty13 Posted June 1, 2011 Report 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now