PDA

View Full Version : syntax shmyntax


gengar003
08-17-2003, 09:57 PM
bah...

$DB_site->query("DELETE FROM `tacemonquery` WHERE `name`='$th_rite_name', `catchname`='$th_rong_name', `data`='$data'");




... Where's the syntax error?

SmEdD
08-17-2003, 10:08 PM
Thy this

$DB_site->query("DELETE FROM tacemonquery WHERE name = $th_rite_name");

filburt1
08-17-2003, 10:09 PM
Make sure you're escaping the variables when appropriate. Also it's against ANSI SQL standards to use quotes around column names.

Dean C
08-18-2003, 10:37 AM
What he said^^ :). It's easier to give each row in a table an id reference. Then you can delete by id btw :)

- miSt

gengar003
08-18-2003, 11:08 PM
Well, I don't really know "When Appropriate" but, yes, I kind of thought that the quotes were the problem, but in that same php file, the query wouldn't run w/out quotes, and I got the sql from phpmyadmin, so, anyway.

I'll try that, thx.

P.S. - OMG Vb.org is so cool, i have a problem, and i post it, and what, 2 or sometimes 3 people reply WHO ACTUALLY CAN HELP! it's freakin' awesome! =^_^=

AND, smedd removed some of the code, and it'll still work >.< I'm a silly hamster. GEEZ you people are so smart.

EDIT: This is the code that works....


$DB_site->query("DELETE FROM tacemonquery WHERE name = '$th_rite_name'");


Thanks again, all.

Whoa, another EDIT: OMFG!!!! I'm listed as a "Super Hacker!!!"

COOl!