Re: Math and mySQL
| From: | Bastien Koert | Date: | Sat, 01 Jan 2005 17:32:47 +0000 |
| Subject: | Re: Math and mySQL | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37944@lists.php.net to get a copy of this message | ||
select MAX(id), * from tablename
you can also use a datetime field to select from as well, depends on your data structure
bastien
From: "Ron Piggott" <ron.php@actsministries.org> To: "Bastien Koert" <bastien_k@hotmail.com>, <php-db@lists.php.net> Subject: Re: [PHP-DB] Math and mySQL Date: Fri, 31 Dec 2004 20:53:10 -0500 Do you have the actual syntax for the SELECT command to retreive the last record? Ron ----- Original Message ----- From: Bastien Koert <bastien_k@hotmail.com> To: <ron.php@actsministries.org>; <php-db@lists.php.net> Sent: Thursday, December 30, 2004 10:53 AM Subject: RE: [PHP-DB] Math and mySQL see intersperesed comments bastienFrom: "Ron Piggott" <ron.php@actsministries.org> To: "PHP DB" <php-db@lists.php.net> Subject: [PHP-DB] Math and mySQL Date: Thu, 30 Dec 2004 05:51:44 -0500 Is there any way of retreiving the last record of a mySQL table where Imayspecify one of the values in it? I know the SELECT command and justforexample the field I know could be serial_number = 30612312-ABDEFG --- I have the serial_number field set as a varchar.yes, you can do a select on the table to get that recordPart two of my question is how do you do math in PHP? I want to taketherunning_total (another field in the table) and add or subtract what the user has typed in.assign the value to a variable and simply add/substract/etc between the two valuesRon -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php