Syrehn Posted January 26, 2010 Share Posted January 26, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/189908-help-with-sql-table/ Share on other sites More sharing options...
whansen02 Posted January 27, 2010 Share Posted January 27, 2010 Well the easiest way is if your web host setup has PHPMyAdmin installed and if you go in there - you can select the database to work with, select "SQL" at the top/middle of the interface and it'll give you a textarea where you can paste that code in and run it. Quote Link to comment https://forums.phpfreaks.com/topic/189908-help-with-sql-table/#findComment-1002154 Share on other sites More sharing options...
Syrehn Posted January 27, 2010 Author Share Posted January 27, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/189908-help-with-sql-table/#findComment-1002444 Share on other sites More sharing options...
fenway Posted January 28, 2010 Share Posted January 28, 2010 You seem to have strange quotes all over the place. Quote Link to comment https://forums.phpfreaks.com/topic/189908-help-with-sql-table/#findComment-1002796 Share on other sites More sharing options...
Syrehn Posted January 28, 2010 Author Share Posted January 28, 2010 there is? i didn't write that, so i'm not sure which quotes shouldn't be there? Quote Link to comment https://forums.phpfreaks.com/topic/189908-help-with-sql-table/#findComment-1003122 Share on other sites More sharing options...
pquery Posted January 30, 2010 Share Posted January 30, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/189908-help-with-sql-table/#findComment-1004040 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.