For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > March 2005 > RE: [PHP-DB] What wrong with my Query??









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] What wrong with my Query??
Bastien Koert

2005-03-25, 3:55 am

limit is a mysql keyword...change that field name and the corresonding names
in your sql

bastien

>From: "HarryG" <harry1980@gmail.com>
>To: php-db@lists.php.net
>Subject: [PHP-DB] What wrong with my Query??
>Date: Fri, 25 Mar 2005 16:26:38 +1100
>
>What the hell is wrong with this MYSQL query?? PHP keeps giving me the
>error message:
>
>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 'limit=20000,
>name='test1', email='atest@test.com', password='t
>
>$query = "INSERT INTO mfadmin SET id='', account='$accname_lc',
>limit=$plans, name='$yourname', email='$email', password='$password',
>lastlogin='$datetoday', datecreated='$datetoday', expiry='$expirydate',
>lastip=123.123.123.123";
>
>This is my table structure
>CREATE TABLE `admin` (
> `id` int(10) unsigned NOT NULL auto_increment,
> `account` varchar(50) NOT NULL default '',
> `limit` int(10) unsigned NOT NULL default '0',
> `name` varchar(50) NOT NULL default '',
> `email` varchar(50) NOT NULL default '',
> `password` varchar(50) NOT NULL default '',
> `lastlogin` varchar(50) NOT NULL default '',
> `datecreated` varchar(50) NOT NULL default '',
> `expiry` varchar(50) NOT NULL default '',
> `lastip` varchar(50) NOT NULL default '',
> PRIMARY KEY (`id`)
> ) TYPE=MyISAM;

HarryG

2005-03-25, 3:55 am

thanks. Stupid me. I've been banging by head for the last two hours.


"Bastien Koert" <bastien_k@hotmail.com> wrote in message
news:BAY21-F3F5D399CFF651F190352A9D410@phx.gbl...
> limit is a mysql keyword...change that field name and the corresonding

names[color=darkred]
> in your sql
>
> bastien
>
to[color=darkred]
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com