PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Error on Insert
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Error on Insert

Réponse
 
LinkBack Outils de la discussion
Vieux 29/12/2007, 00h50   #1
AMP
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Error on Insert

Hello,
I am going crazy. I cant find the problem with this statement, But I
keep getting the error:
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'References(ref_key, ref_email, ref_name,
applic_id)VALUES('304861584','ref1@amps' at line 1

Here is the query sent by php:
Insert into References(ref_key, ref_email, ref_name,
applic_id)VALUES('304861584','ref1@ampsoft.com','B ob',58)

And a dump of the table structure:

CREATE TABLE `References` (
`ref_id` mediumint(10) unsigned NOT NULL auto_increment,
`applic_id` mediumint(8) unsigned default NULL,
`ref_email` varchar(50) default NULL,
`ref_name` varchar(255) default NULL,
`ref_key` varchar(10) default NULL,
`ref_sent` date default NULL,
`ref_received` date default NULL,
PRIMARY KEY (`ref_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Any ?
Thanks
Mike

  Réponse avec citation
Vieux 29/12/2007, 01h23   #2
Peter H. Coffin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Error on Insert

On Fri, 28 Dec 2007 16:50:11 -0800 (PST), AMP wrote:
> Hello,
> I am going crazy. I cant find the problem with this statement, But I
> keep getting the error:
> You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near 'References(ref_key, ref_email, ref_name,
> applic_id)VALUES('304861584','ref1@amps' at line 1
>
> Here is the query sent by php:
> Insert into References(ref_key, ref_email, ref_name,
> applic_id)VALUES('304861584','ref1@ampsoft.com','B ob',58)
>
> And a dump of the table structure:
>
> CREATE TABLE `References` (
> `ref_id` mediumint(10) unsigned NOT NULL auto_increment,
> `applic_id` mediumint(8) unsigned default NULL,
> `ref_email` varchar(50) default NULL,
> `ref_name` varchar(255) default NULL,
> `ref_key` varchar(10) default NULL,
> `ref_sent` date default NULL,
> `ref_received` date default NULL,
> PRIMARY KEY (`ref_id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


"References" is a reserved work in mysql. either change your table name
or backtick it like the table structure shows.

--
42. When I capture the hero, I will make sure I also get his dog, monkey,
ferret, or whatever sickeningly cute little animal capable of untying
ropes and filching keys happens to follow him around.
--Peter Anspach's list of things to do as an Evil Overlord
  Réponse avec citation
Vieux 29/12/2007, 01h44   #3
AMP
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Error on Insert

On Dec 28, 8:23pm, "Peter H. Coffin" <hell...@ninehells.com> wrote:
> On Fri, 28 Dec 2007 16:50:11 -0800 (PST), AMP wrote:
> > Hello,
> > I am going crazy. I cant find the problem with this statement, But I
> > keep getting the error:
> > You have an error in your SQL syntax; check the manual that
> > corresponds to your MySQL server version for the right syntax to use
> > near 'References(ref_key, ref_email, ref_name,
> > applic_id)VALUES('304861584','ref1@amps' at line 1

>
> > Here is the query sent by php:
> > Insert into References(ref_key, ref_email, ref_name,
> > applic_id)VALUES('304861584','r...@ampsoft.com','B ob',58)

>
> > And a dump of the table structure:

>
> > CREATE TABLE `References` (
> > `ref_id` mediumint(10) unsigned NOT NULL auto_increment,
> > `applic_id` mediumint(8) unsigned default NULL,
> > `ref_email` varchar(50) default NULL,
> > `ref_name` varchar(255) default NULL,
> > `ref_key` varchar(10) default NULL,
> > `ref_sent` date default NULL,
> > `ref_received` date default NULL,
> > PRIMARY KEY (`ref_id`)
> > ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

>
> "References" is a reserved work in mysql. either change your table name
> or backtick it like the table structure shows.
>
> --
> 42. When I capture the hero, I will make sure I also get his dog, monkey,
> ferret, or whatever sickeningly cute little animal capable of untying
> ropes and filching keys happens to follow him around.
> --Peter Anspach's list of things to do as an Evil Overlord- Hide quoted text -
>
> - Show quoted text -


Great, I never thought to check!
Is there a method of getting better error messages?
Thanks
Mike
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h30.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09695 seconds with 11 queries