Re: [PHP] Getting the last record in a mysql table

2002-01-17 Thread Alex Chau

Another option under same condition is:

'SELECT MAX(ID) AS LASTID FROM MY_TABLE'

Alex Chau

Niklas Lampén wrote:

If you have ID that is a incrementing number, you could just query like
this:
'SELECT ID FROM MY_TABLE ORDER BY ID DESC, LIMIT 1'

And there you have just one result, the last (biggest) ID number.


Niklas


-Original Message-
From: hugh danaher [mailto:[EMAIL PROTECTED]] 
Sent: 18. tammikuuta 2002 7:37
To: Php-General
Subject: [PHP] Getting the last record in a mysql table


Help!
I thought this would be easy but it ain't.  What I want is the id number
of the last record in a table.  I've tried a number of variations to the
following but am getting no where!  Any help will be greatly
appreciated. Hugh


$results=mysql_query( SELECT last_insert_id() FROM MY_TABLE );
$row=mysql_fetch_assoc($results);  while
($row=mysql_fetch_row($results))
  {
  print tr;
  foreach($row as $field) 
   {
   if ($field==)
{
$field=nbsp;;
}
   print td align=centerh5.$field./h5/td;
   }
  print /tr;
  }
 print /table/td/tr/table;





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] can php detect whether an email address is a valid one?

2001-11-13 Thread Alex Chau

I have a php script sending newsletter to a mailing list time by time, 
but some emails are no longer exist, so I need to remove them manually.
Can php detect whether an email address is a valid one, then remove it 
from the list automatically? no matter before or after the newsletter 
has sent.

Thanks in advance.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]