I used PASSWORD(’$variable’) before but it wouldn’t add anything to the database. It’s working now though.
Instead of me making another thread, i was wondering if you could give me some more advice…
I’ve got a table that contains the users of this particular part of the site and want to set up a way to control these users. I’ve just finished the part that lets you add a user, now i’m onto deleting…
The table has four fields user_id which is the username, full_name, email and password. Is it possible to delete a user from the database with the following query??
For some reason it is telling me that the column called whatever is in $user_id doesn’t exist.
I’m sure it would be better practice to have an actual number for a user_id instead of doing it the way i’m doing it. For now it would be easier to get it working this way that’s why i ask if it’s possible. Thanks
$user_id = $_GET['uid'];
// Connect to the database and run the query
$dbid = mysql_connect ('localhost', 'user', 'pass');
or die ("Cannot find database");
$query = "DELETE FROM auth_user WHERE user_id = $user_id";
$result = mysql_query($query,$dbid)
or die("Delete error:".mysql_error());