|
||||||||||||
|
If you have any doubts with your PHP code please discuss it in the PHP Forum Display The Most Recently Added Results From An SQL TableRelational database theory states that row order in a database is not guaranteed. Some database engines may add rows that are physically where you would expect them to be, but others may not, and deletions or updates may affect this order, too. The point is this: you should always select records based on the data that is contained in the records, never on what you assume is the order of the records on the storage device. To find the most recently added record from the table, include a field in the table with auto increment. Then use this querry Here 'id' is the field with the autoincrement property. This will display field 1 of the most recently added record. Want to clear doubts about this code? Sorting Data in Alphabetical order<?php Want to clear doubts about this code? Getting Data from MySQLThe following code will display the records from the database in the following format. Field1 Field1 of record1 Field2 of record1 ------ Field2 Field2 of record2 Field2 of record2 ------ $result = mysql_query("SELECT * FROM tablename "); Want to clear doubts about this code? Format Alternate Rows in Different Colors
Copyright © 2008 www.worth2read.org. All rights Reserved. Use of this Site is subject to our Privacy Statement |
| ||||||||||
| Programming PHP |
||||||||||||
| Beginning PHP and MySQL: From Novice to Professional, Third Edition (Beginning from Novice to Professional) |
||||||||||||
| Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems |
||||||||||||
| PHP and MySQL Web Development (3rd Edition) (Developer's Library) |
||||||||||||
| PHP & MySQL For Dummies 3rd edition (For Dummies (Computer/Tech)) |
||||||||||||
| PHP Solutions: Dynamic Web Design Made Easy (Solutions) |
||||||||||||
| Build Your Own Website The Right Way Using HTML & CSS |
||||||||||||
| Learning Web Design: A Beginner's Guide to (X)HTML, StyleSheets, and Web Graphics |
||||||||||||
| Sams Teach Yourself HTML and CSS in 24 Hours (7th Edition) (Sams Teach Yourself) |
||||||||||||