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, $password))) {
    DisplayErrMsg(spintf("error conectando al host %s por el usuario %s",
                          $hostName, $userName));
//Select DB
if (!mysql_select_db($databaseName, $link)) {
    DisplayErrMsg(sprintf("Error seleccionando %s database", $databaseName));
    DisplayErrMsg(sprintf("error: %d %s", mysql_errno($link), 
mysql_error($link))) ;

//Execute the Statement
if (!mysql_query($deleteStmt, $link)) {
    DisplayErrMsg(sprintf("Error in ejecutando %s mandato", $deleteStmt)) ;
    DisplayErrMsg(sptintf("error: %d %s", mysql_erro($link), 
mysql_error($link))) ;

- Jp

At 12:30 31/05/02, 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";
>  $result = @mysql_query($sql, $dbh) or die ("Could not execute query.
>Please try again later.");
>Its not deleting the records based on a hidden field in a form named
>Any help would be great!
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

Juan Pablo Aqueveque <[EMAIL PROTECTED]>
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to