Page 1 of 1

will this work

Posted: Mon Sep 21, 2009 1:40 pm
by gotornot
$delq = "DELETE FROM '$tablename' WHERE id='$id'";
will this work?

Re: will this work

Posted: Mon Sep 21, 2009 1:54 pm
by requinix
What makes you think that's anywhere near the amount of information we need to give you an answer?

Re: will this work

Posted: Mon Sep 21, 2009 2:04 pm
by gotornot
sorry
all i wondered was is the fatc that the variable $tablename sitting inside the string would work becaus ei cant seem to get it to any ideas?

Re: will this work

Posted: Mon Sep 21, 2009 2:07 pm
by requinix
Without any PHP variables - just plain SQL - what does a DELETE query look like? You can use whatever names you want.

Re: will this work

Posted: Mon Sep 21, 2009 3:01 pm
by jackpf
I have an idea - why don't you go and test it and find out?

Re: will this work

Posted: Mon Sep 21, 2009 4:30 pm
by Mirge
jackpf wrote:I have an idea - why don't you go and test it and find out?
Would seem like the sensible thing to do.

Re: will this work

Posted: Mon Sep 21, 2009 4:35 pm
by Mark Baker
I predict it will compain about the quotes around '$tablename' when it should be backticks

Re: will this work

Posted: Mon Sep 21, 2009 5:35 pm
by jackpf
It probably will. So use backticks ;)