Welcome! Log In Create A New Profile

Advanced

Unable to run SQL for oop4

Posted by Imtiyaaz 
Announcements Last Post
Announcement myUnisa availability 21 to 24 March 2019 03/17/2019 02:24PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Unable to run SQL for oop4
April 04, 2012 08:45PM
Hi Mac

In phpMyAdmin I select the SQL tab and run the below SQL

Language: SQL
CREATE TABLE IF NOT EXISTS 'users'( 'user_id' int(11) NOT NULL AUTO_INCREMENT, 'first_name' varchar(20) DEFAULT NULL, 'last_name' varchar(50) DEFAULT NULL, 'display_name' varchar(50) DEFAULT NULL, PRIMARY KEY('user_id') )ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7;

then I get the following 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 ''users'( 'user_id' int(11) NOT NULL AUTO_INCREMENT, 'first_name' varchar(20) D' at line 1

I get the same error when running CREATE TABLE IF NOT EXISTS 'user_friends'()

Am I doing this right? Are we suppose to run this SQL in phpMyAdmin to create the tables and insert the data

Please assist

***Lets go back to my place and I will show you my source code***
avatar
Mac
Re: Unable to run SQL for oop4
April 05, 2012 08:14AM
The error is related to the version of mySQL running, since the code is correct.

Simply use phpMyAdmin to create the table/fields one by one. Click on the structure tab, and at the bottom, define the table, number of fields, which will lead you to the next page where you can type it in one by one etc.
Re: Unable to run SQL for oop4
April 05, 2012 08:41AM
Thanksthumbs up

***Lets go back to my place and I will show you my source code***
Sorry, you do not have permission to post/reply in this forum.