Re: [PHP-DB] new pair of eyes

2002-05-31 Thread Adam Royle
Hey there, I was just looking at your code, and I also look at other's code, and I think people are making life difficult for themselves. Sure a lot of people on this list are beginners, but thats more te reason to simplify code... One thing you should always do, is write functions... I have

Re: [PHP-DB] new pair of eyes

2002-05-31 Thread Juan Pablo Aqueveque
If I want to delete a record, I simply put this (the rest is not necessary): $sql="DELETE from $tableName where ROWID=$rowid"; OK, now the complete routine would be: $deleteStmt="DELETE from $tableName where ROWID=$rowid" ; //Connect to the DB if (!($link=mysql_pconnect($hostName, $userName,

Re: [PHP-DB] new pair of eyes

2002-05-31 Thread Jason Wong
On Saturday 01 June 2002 00:30, Jas wrote: > I think I am missing something: > $db_name = "database"; > $table_name = "auth_users"; > $sql = "DELETE user_id, f_name, l_name, email_addy, un, pw FROM > $table_name WHERE user_id = \"$user_id\", $dbh"; The MySQL syntax for DELETE is: DELETE FROM

[PHP-DB] new pair of eyes

2002-05-31 Thread Jas
I think I am missing something: $db_name = "database"; $table_name = "auth_users"; $sql = "DELETE user_id, f_name, l_name, email_addy, un, pw FROM $table_name WHERE user_id = \"$user_id\", $dbh"; $result = @mysql_query($sql, $dbh) or die ("Could not execute query. Please try again later."); Its