English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi,

Heres my query:

$query = "INSERT INTO tags (tag_id, tagger_id, location_name) VALUES ('$fn', '$ln', '$e')";

My problem is that it only works when tag_id, tagger_id, location_name are in the database as the first three columns, what am I doing wrong?

2007-08-15 12:24:14 · 3 answers · asked by jeff lemon 1 in Computers & Internet Programming & Design

3 answers

You are naming the columns so that shouldn't be your problem. What language and database are you using? Try using this query directly with the sql tool outside of the language you are using.

2007-08-15 17:46:04 · answer #1 · answered by nonlinear 6 · 0 0

Try to add "`" for each field name:

$query = "INSERT INTO tags(`tag_id`, `tagger_id`, `location_name`) VALUES ('$fn', '$ln', '$e')";

2007-08-16 01:13:28 · answer #2 · answered by Bambou Chantant 6 · 0 0

Your syntax is, as usual, wrong.
In the time it takes you to ask questions and wait for answers, you would have learnt HTML, java, PhP and MySQL properly.

2007-08-16 01:01:58 · answer #3 · answered by just "JR" 7 · 0 0

fedest.com, questions and answers