I'm just know that this query  
$query="DELETE FROM newsa ORDER BY id DESC LIMIT 1";
is exist :D. i'm only think the ORDER BY statement is only work with SELECT 
statement before.
BTW, before you delete the last row which you entered to the database, you must 
get the last "id" using 
"SELECT max(id) form newsa";
n then you will get the last record data according the id.
so in delete query is like this :
"DELETE FROM newsa where id='$id'";


Tedit kap <[EMAIL PROTECTED]> wrote:                             Hello,
 I have a simple mysql query that updates the database as given below "working 
mysql input statement"....On top of that, I want to add this DELETE query, so 
that if i make vrb12 = erase, i want it to delete the last row I entered to the 
database. or, if vrb12 is not equal to "erase", then i want the wokring 
statement below "else" to execute and update the database. I get vrb12 through 
a form that send data to this page. 
 But it is not working. Any advice?
 if($vrb12="erase")
 {
 $query="DELETE FROM newsa ORDER BY id DESC LIMIT 1";
 mysql_query($query) or die (' I could not erase the last row');
 }
 
 else
 {----working mysql input statement to update the database---}
 
 __________________________________________________________
 Be a better friend, newshound, and 
 know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
 
 [Non-text portions of this message have been removed]
 
 
     
                                       




       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

Reply via email to