What exactly are you trying to do?  Drop a database or delete a row from
your table?  Your DELETE syntax is right but when you refer to db, what do
you mean?  The delete statement is designed to delete a row from a table.
The syntax is:  DELETE FROM table-name WHERE column-name = something.  The
column-name must be a valid column name in an existing table (table-name).
The something must contain a valid value in the table.

We really can't tell what the error is since you didn't include the actual
return code number in your message.  The list can only speculate what you
are trying to do.

Peter J. Krawetzky

-----Original Message-----
From: John Miller <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, February 19, 2001 8:35 PM
Subject: [PHP-DB] Deleting single record


>
>>The following big chunk of code produces the following line:
>>uukjh has been deletedMySql has been selectedDELETE FROM db WHERE Db =
>>uukjhUser Db has failed
>>Which tells me that everything but the delete command does not work.
>>
>>The above line is broken down to database name has been deleted, The
>>selecting of the database worked, my sql command looks good (I think) and
>>that the delete command failed.  When I log in the MySql through the
>>command promt, the record is still there.  I have compared the command
that
>>I type into delete the record to the one that the computer products and
>>there is no differenct.
>>
>>Please help
>>John
>>
>>
>>$link = @mysql_connect("","$PHP_AUTH_USER","$PHP_AUTH_PW")
>>             or die ("$PHP_AUTH_USER is not authorized to delete the
>> database");
>>     $result = mysql_drop_db($db_name,$link);
>>     if ($result) {
>>          echo "$db_name has been deleted";
>>      } else {
>>          printf("Unable to delete $db_name\n");
>>          echo mysql_error($link);
>>      }
>>
>>      $link = @mysql_connect("","youknowwho","nonofyourbusiness")
>>          or die("Unable to connect to update db table" );
>>      $selected = @mysql_select_db("mysql",$link);
>>      if ($selected) {
>>          echo "MySql has been selected";
>>      } else {
>>          echo "Can't select MySql";
>>          exit;
>>      }
>>      $sql = "DELETE FROM db WHERE Db = $db_name";
>>      echo $sql;
>>      $result = @mysql_query("$sql","$link");
>>       //         or die("Could not update User Db");
>>      echo mysql_error($link);
>>      echo $result;
>>      if ($result) {
>>          echo "User Db is updated";
>>      } else {
>>          echo "User Db has failed";
>>      }
>
>
>--
>PHP Database 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 Database 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]

Reply via email to