LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-18-2015, 01:27 PM   #1
otsoga
LQ Newbie
 
Registered: May 2015
Location: Miami, FL
Distribution: Slackware 14.2
Posts: 12

Rep: Reputation: Disabled
MySQL Syntax Error


Can someone tell me what is causing the syntax error here? I believe it has something to do with this code being for an old version of MySQL.

$dbh->do('CREATE TABLE cands (candid smallint unsigned NOT NULL, pid smallint unsigned NOT NULL, cand varchar(50) NOT NULL, info text, resources text, references text, candtype tinyint unsigned NOT NULL, equiv tinyint unsigned, result varchar(30), actstatus tinyint unsigned NOT NULL default \'1\', moddate timestamp NOT NULL, PRIMARY KEY(candid,pid), KEY cand (cand), KEY candtype(candtype), KEY equiv(equiv), KEY result(result), KEY actstatus(actstatus), KEY moddate(moddate)) ENGINE=InnoDB');

This is the error message I get:

DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'references text, candtype tinyint unsigned NOT NULL, equiv tinyint unsigned, res' at line 1 at ./create.pl line 96.

Last edited by otsoga; 06-18-2015 at 01:28 PM.
 
Old 06-18-2015, 02:14 PM   #2
otsoga
LQ Newbie
 
Registered: May 2015
Location: Miami, FL
Distribution: Slackware 14.2
Posts: 12

Original Poster
Rep: Reputation: Disabled
Someone told me that the problem is that "references" is now a reserved word, so I should change it to something else.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] MySQL Syntax Error worm5252 Programming 5 02-10-2010 10:12 PM
[SOLVED] MySQL Error when cerating FK in tables, can't pinpoint the syntax error jason.rohde Programming 4 12-13-2009 11:50 PM
perl dbi:mysql shows error syntax error dbi:mysql ?? haxpak Linux - Server 4 02-26-2009 11:09 PM
php / MySQL: You have an error in your SQL syntax error FirstBorn Programming 6 12-31-2008 05:46 PM
MySQL Syntax Error? taylor_venable Programming 2 06-10-2007 08:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration