SQL deleating a row

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
parkofgrey
Forum Newbie
Posts: 2
Joined: Sun Jan 16, 2005 8:19 pm

SQL deleating a row

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
parkofgrey
Forum Newbie
Posts: 2
Joined: Sun Jan 16, 2005 8:19 pm

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the code you posted won't even compile without extra help. I don't see how this is the real code.
Post Reply