zero-perfoliate
zero-perfoliate

Author Topic: Mysql_query error PHP  (Read 526 times)

Offline danoussh

  • New PHP Members
  • Posts: 3
  • Karma: +0/-0
Mysql_query error PHP
« on: March 20, 2010, 04:37:04 PM »
Hi everyone, thanks for having this type of forum. Hope you will be able to help me :)

So here is my script, the idea is basic, complete a html form and subtmit the data to php script which will send the data in a SQL table. It also uploads pictures.

Now the script isn't perfect yet, it still needs some conditions and stuff for all situation.
But for now the important part, i need to find out why i cannot store data in the database.

Systeme Config:
  • WampServer Version 2.0
  • Apache 2.2.11
  • PHP 5.3.0, Default configs
  • MySQL 5.1.36

There was something in my script that makes your website go nuts (Internal Error+ additional 404) so i pasted it on PasteBin, i hope this is ok with everyone.

http://pastebin.com/u4dy7Sr5

Thanks in advance.
Danoussh

Offline danoussh

  • New PHP Members
  • Posts: 3
  • Karma: +0/-0
Re: Mysql_query error PHP
« Reply #1 on: March 20, 2010, 04:41:47 PM »
Forgot to port the error:

http://pastebin.com/riS2sSgh

Offline RoseKnight

  • PHP Help Guru's
  • ****
  • Posts: 52
  • Karma: +0/-0
Re: Mysql_query error PHP
« Reply #2 on: March 20, 2010, 10:22:10 PM »
MYSQL likes it when you surround table names and key names with the tilde `

so try changing 'release' to `release`and see what happens

Offline danoussh

  • New PHP Members
  • Posts: 3
  • Karma: +0/-0
Re: Mysql_query error PHP
« Reply #3 on: March 21, 2010, 06:15:40 AM »
Thank you RoseKnight .

But i'm a little surprised, wouldn't it also work not using any tilde ( ` ) or anything else.
Some tutorials don't have this detail.

But i suppose it always better to use it anyway.

Danoussh

Offline RoseKnight

  • PHP Help Guru's
  • ****
  • Posts: 52
  • Karma: +0/-0
Re: Mysql_query error PHP
« Reply #4 on: March 21, 2010, 06:35:35 AM »
I spent around 5 hours while learning MYSQL debugging just to find that out. I have no idea why it it's like that. It's rather annoying, and odd that its not in any tutorials.

Offline RoseKnight

  • PHP Help Guru's
  • ****
  • Posts: 52
  • Karma: +0/-0
Re: Mysql_query error PHP
« Reply #5 on: March 21, 2010, 07:11:41 AM »
as a side note, this ~ is a tilde and this ` is an acute . How did I mix those two up? sorry... (:

Offline tequilaprince

  • New PHP Members
  • Posts: 3
  • Karma: +0/-0
Re: Mysql_query error PHP
« Reply #6 on: March 23, 2010, 06:30:53 AM »
It looks like RELEASE is a reserved word in MySQL, I had a similar problem with Date as a fieldname and Drop as a table name (DANGEROUS LOL).  Try if possible adding a tbl or something to the table name in your database and the query...  the ` replies above should act similar to this but if that failed this might work... always worth a shot

hotnoob

  • Guest
Re: Mysql_query error PHP
« Reply #7 on: March 24, 2010, 09:08:15 AM »
uhh... i always thought that the "`" was just plain old obvious..

`` is for names
'' is for values
that's how it works.