Jump to content

Help with SQL table


Syrehn

Recommended Posts

Ok, I'm totally new to the php/mysql scene so bear with me.

 

I'm trying to install and test the following script:

 

http://www.michelhiemstra.nl/blog/igoogle-like-drag-drop-portal-v20/

 

 

In the comments it says that the SQL for creating the table and required fields is:

–
– Table structure for table `blocks`
–

CREATE TABLE `blocks` (
`unique_id` int(11) NOT NULL auto_increment,
`block_id` varchar(255) NOT NULL default ”,
`column_id` varchar(255) NOT NULL default ”,
`order_id` int(11) NOT NULL default ‘0′,
PRIMARY KEY (`unique_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

–
– Dumping data for table `blocks`
–

INSERT INTO `blocks` VALUES(1, ‘block-1′, ‘column-1′, 0);
INSERT INTO `blocks` VALUES(2, ‘block-3′, ‘column-2′, 0);
INSERT INTO `blocks` VALUES(3, ‘block-2′, ‘column-3′, 0);
INSERT INTO `blocks` VALUES(4, ‘block-4′, ‘column-2′, 1);

 

I'm not exactly sure how to add this and if I put it in a text file and try to import it I get errors.

 

I know I'm probably doing something very wrong.  Can anyone help?

Link to comment
Share on other sites

I am trying to test this on my local server first and yes I do have phpmyadmin v3.

 

So when I go to the database and click the sql tab it says run queries.  so if i copy all of the following code:

 

–
– Table structure for table `blocks`
–

CREATE TABLE `blocks` (
`unique_id` int(11) NOT NULL auto_increment,
`block_id` varchar(255) NOT NULL default ”,
`column_id` varchar(255) NOT NULL default ”,
`order_id` int(11) NOT NULL default ‘0′,
PRIMARY KEY (`unique_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

–
– Dumping data for table `blocks`
–

INSERT INTO `blocks` VALUES(1, ‘block-1′, ‘column-1′, 0);
INSERT INTO `blocks` VALUES(2, ‘block-3′, ‘column-2′, 0);
INSERT INTO `blocks` VALUES(3, ‘block-2′, ‘column-3′, 0);
INSERT INTO `blocks` VALUES(4, ‘block-4′, ‘column-2′, 1);

 

it generates the following errors:

 

Error

SQL query:

–– TABLE structure FOR TABLE `blocks` – CREATE TABLE `blocks` (
`unique_id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`block_id` varchar( 255 ) NOT NULL default”,
`column_id` varchar( 255 ) NOT NULL default”,
`order_id` int( 11 ) NOT NULL default‘0′,
PRIMARY KEY ( `unique_id` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =8;

MySQL said: Documentation
#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 '–
– Table structure for table `blocks`
–

CREATE TABLE `blocks` (
`un' at line 1

 

I'm not exactly sure what that means or how to fix it.  Can anyone shed some light?

Link to comment
Share on other sites

That file looks like it was opened up (or created in) a Microsoft product, especially Word. That's where those inverted quotes come from all the time I've found.

 

What might help you is if you take the whole .sql file, copy and paste it to notepad (NOT word pad) and then save it as .txt or .sql, re-open it and try re-pasting into your browser.

 

I'm guessing that maybe you're doing all of this on a windows based system?

 

That can "wash" the script of the funny single and double quotes that could be hampering your script.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.