Jump to content


Photo

[mysql query] it looked good but it gives an error *solved*


  • Please log in to reply
2 replies to this topic

#1 tistaharahap

tistaharahap
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 17 September 2006 - 10:51 PM

This is my QUERY:

$query = "INSERT INTO tshirt (name, pricerp, priceusd, colors, sizes, desc, " .
"bthumbname, bthumbsize, bthumbpath, bthumbtype, " .
"pictname, pictsize, pictpath, picttype, " .
"sthumb1name, sthumb1size, sthumb1path, sthumb1type, " .
"sthumb2name, sthumb2size, sthumb2path, sthumb2type, " .
"sthumb3name, sthumb3size, sthumb3path, sthumb3type) VALUES " .
"('$tname', '$pricerp', '$priceusd', '$colors', '$sizes', '$desc', " .
"'$filename[1]', $filesize[1], '$filepath[1]', '$filetype[1]', " .
"'$filename[0]', $filesize[0], '$filepath[0]', '$filetype[0]', " .
"'$filename[2]', $filesize[2], '$filepath[2]', '$filetype[2]', " .
"'$filename[3]', $filesize[3], '$filepath[3]', '$filetype[3]', " .
"'$filename[4]', $filesize[4], '$filepath[4]', '$filetype[4]')";


After examining a few times, I can't find anything wrong. Is there anything wrong with this? MySQL keeps telling me to recheck the syntax. Please help. Pleasee...

#2 shoz

shoz
  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 17 September 2006 - 11:27 PM

http://www.phpfreaks...c,108300.0.html

If you're still having trouble, post the query (with variables expanded) and the error.

#3 tistaharahap

tistaharahap
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 17 September 2006 - 11:38 PM

Thanks for the info. I got it fix.

One of the column names (desc) was a keyword in MySQL when I tried to hook it up in MySQL Query Browser. I changed the column name and it all worked just great. Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users