Page 1 of 1

SQL deleating a row

Posted: Tue Jan 25, 2005 6:17 pm
by parkofgrey
$select = $_POST["select"];
$link = mysql_connect("localhost", "", "");
if(!link)
die("couldn't connect to mySQL");
$lico = "DELETE FROM users WHERE username = 'sam'";
MySQL("test", $lico);

select returns user, but when i try and run the sql command

Posted: Tue Jan 25, 2005 6:20 pm
by feyd
this obviously isn't the real code, please post your real code. And an explaination of what you are trying to do and what is currently happening.

Posted: Tue Jan 25, 2005 8:42 pm
by parkofgrey
dude thats the code, i wrote it and it dosent work and i dont know how to do this.

$select comes from a form which contains a generated list of all the "usernames" in a sql table, trying to get the script to get the selected name, and then remove the row of where the sql username exists

Posted: Tue Jan 25, 2005 8:53 pm
by feyd
the code you posted won't even compile without extra help. I don't see how this is the real code.