473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

I have an error in your SQL syntax;

Hi

I am getting this error #1064 - 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 '$result="CREATE TABLE 'course`(
`cname` varchar(50) NOT NULL default,
`cid` in' at line 1
when I am adding my code to the data base
I dont understand the error that well and cant find any problem to my code can you pleas help is is my server ore my actual code

Expand|Select|Wrap|Line Numbers
  1. $result="CREATE TABLE 'course`(
  2. `cname` varchar(50) NOT NULL default,
  3. `cid` int(6) NOT NULL auto_increment,
  4. PRIMARY KEY (`cid`)
  5. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1";
  6.  
  7.  
  8. $sno="CREATE TABLE `course_student`(
  9. `sno` int(6) NOT NULL default '0',
  10. `cid` int(6) NOT NULL default '0',
  11. `year` int(4) NOT NULL default '0'
  12. ) ENGINE=MyISAM DEFAULT CHARSET=latin1";
  13.  
  14.  
Thanks
May 14 '10 #1
3 1615
dlite922
1,584 Expert 1GB
Course table is surrounded by a comma and a back-tick. Start and end characters must be the same, can't combine different characters.

Expand|Select|Wrap|Line Numbers
  1. turn this 
  2.  
  3. CREATE TABLE 'course`(
  4.  
  5. into 
  6.  
  7. CREATE TABLE `course`(
Dan
May 14 '10 #2
Hi

I have changed that and made it all the same

Expand|Select|Wrap|Line Numbers
  1.  $result="CREATE TABLE `course`(
  2. `cname` varchar(50) NOT NULL default,
  3. `cid` int(6) NOT NULL auto_increment,
  4. PRIMARY KEY (`cid`)
  5. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1";
  6.  
but I am still getting the same error
May 15 '10 #3
Try this

Expand|Select|Wrap|Line Numbers
  1. $result="CREATE TABLE `course`(
  2. `cname` varchar(50) NOT NULL default '',
  3. `cid` int(6) NOT NULL auto_increment,
  4. PRIMARY KEY (`cid`)
  5. )  ENGINE = MYISAM CHARACTER SET latin1";
May 15 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Balaji | last post by:
I'm trying to do some basic socket programming. here is the line of code which is creating problem.. int FAR PASCAL __declspec (dllexport)(char * addr,int port) Hers is the error I'm...
2
by: kalpana.sinduria | last post by:
Hi all, how to remove the following complle error. When I compiling the code I get the following errors: Compiling... CDrtEachDefFeat.cpp d:\ include\common\cdrtintegfeat.h(39) : error...
0
by: MWK | last post by:
Hi All, I don't understand why I get "error c2061: syntax error : identifier" in VS2003. I thought it's fixed in .Net 2003: __hook(&TCP_Client::LineReceived, client, HandlerLineReceived); ...
1
by: IceColdFire | last post by:
I have a VC++.net Win32 console application, however when I compile , I get this error error C2146: syntax error : missing ';' before identifier 'Length' Explain... Location pointed is ...
1
by: parveen.beniwal | last post by:
hi all i am having the following line of code in my mak file. !IF "$(CFG)" == "" CFG=DesktopCommon - Win32 Release !MESSAGE No configuration specified. Defaulting to DesktopCommon -...
10
by: bobf | last post by:
I am using a program 'My Contact Table' which is a code generator program. It allows you to easily create a PHP/MySQL web application without writing any code. I am trying to create an additional...
6
by: Pixel.to.life | last post by:
So I have this perfectly fine and running app, that uses managed C++ forms. Problem#1: I pass a Bitmap reference to a class, hoping to modify it in one of the class's methods, so it...
6
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
4
by: srinathvs | last post by:
Hi, I have an access db that I am trying to query from a vb6 program. I've the following code: Dim sSQLQuery As String sSQLQuery = "SELECT * FROM TblData WHERE ID = " & Chr(39) & ID &...
2
shashahayes
by: shashahayes | last post by:
I am getting an error on this line, does anyone have any suggestions? here is the error here is line 25 if area > 750 then charge = 200 1>Furniture.cpp
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.