![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| I'm not very good in mySQL but am trying to modify a php script. It has to do with a log function using a mySQL table to store the log entries. I want to retrieve the last log record (if any) and if the last log entry is the same as my current (to be) entry, simply update the time in the last entry. But if not, simply insert the new entry. My question is how to select the last entry from the log table? I know that I can select all and get the number of rows and then select just the last with a LIMIT of N,1. But is there a better, more efficient way? CREATE TABLE log ( id mediumint(8) unsigned NOT NULL auto_increment, time varchar(20) NOT NULL, entry varchar(255) NOT NULL, PRIMARY KEY (id) ); Thanks. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.497 / Virus Database: 296 - Release Date: 7/4/2003 | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: last, mysql, record, select, table |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding record to a MYSQL DB using PHP ? | James | PHP | 1 | 07-01-2007 3:32 PM |
| UPDATE a record in MYSQL DB with PHP | James | PHP | 1 | 07-01-2007 3:32 PM |
| CSV import to MySql table (MyPHPAdmin) | Joe Gazda | Database | 1 | 06-26-2007 12:08 AM |
| Create a copy of a table using SELECT | Amer Neely | Database | 0 | 06-10-2007 12:22 AM |
| Bulk import of CSV files into a MySQL table | BigDave | Database | 3 | 05-31-2007 8:47 PM |
| Featured Websites | ||||
|