Page 1 of 1

Phpmyadmin prob

Posted: Mon Apr 04, 2011 10:21 am
by yong90
Hye there I need help to my sql coding.When I try to run on phpmyadmin have error.I copy n paste it.

# phpMyadmin SQL Dump
# version 5.5.8
# http://www.phpmyadmin.net
#
# Host: localhost
#
#
#
#
# Database : 'kes3'
#







# ----------------------------------

#


#Table structure for table 'rakan'
#

DROP TABLE IF EXISTS 'rakan';
CREATE TABLE 'rakan' (
'id' int (11) NOT FULL auto_increment,
'nama' varchar (50) NOT NULL default ",
'alamat' varchar (255) NOT NULL default ",
'no_tel' varchar (15) NOT NULL default ",
PRIMARY KEY ('id')
) TYPE=MyISAM AUTO_INCREMENT=7 ;

#
# Dumping data for table 'rakan'
#

INSERT INTO 'rakan' VALUES (2, 'johnson', 'taman juara, \r\nbatu pahat, \r\njohor', '0196474719');
INSERT INTO 'rakan' VALUES (3, 'aminah basir', 'lorong lurus, \r\ntaman manis 2\r\nkuala lumpur', '0123456727';
INSERT INTO 'rakan' VALUES (6, 'harun selamat', 'no 15 taman gah, \r\nparit timur,\r\npahang', '0132475583');

#-------------------------------------
#
# Table structure for table 'user'
#

DROP TABLE IF EXISTS 'USER';
CREATE TABLE 'USER' (
'id' int(3) NOT NULL auto_increment,
'user' varchar (20) NOT NULL default ",
'password' varchar (20) NOT NULL default ",
PRIMARY KEY ('id')
) TYPE=MyISAM AUTO_INCREMNT=2 ;

#
# Dumping data for table 'user'
#

INSERT INTO 'user' VALUES (1, 'saya', '123');


Can help me?

Re: Phpmyadmin prob

Posted: Mon Apr 04, 2011 11:30 am
by greyhoundcode
yong90 wrote:Can help me?
Maybe you could help us a little first - if you mark the SQL code up as being code it will be a lot easier on the eye (hint: use the button marked PHP Code, even if it isn't actually PHP you are asking about). Also, can you tell us what error messages you are getting?

Re: Phpmyadmin prob

Posted: Mon Apr 04, 2011 2:40 pm
by McInfo
Is this a homework assignment? The syntax errors in the document look very intentional and suspiciously like modifications a teacher would make to test a student's ability to recognize valid SQL syntax. They are not things that would appear in a phpMyAdmin dump.

All of errors triggered by the malformed SQL have this format:
#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 ''rakan'' at line 16
Notice that the error tells you what line the syntax error is on and the text where the problem started. In this case, the problem is that the table name "rakan" is enclosed in apostrophes rather than the grave accents (what phpMyAdmin calls "backquotes") that MySQL expects. Read the error messages.
greyhoundcode wrote:(hint: use the button marked PHP Code, even if it isn't actually PHP you are asking about)
Even better, change "syntax=php" to "syntax=sql". Many other languages are also supported.