Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 09-05-2008, 08:24 PM   #1 (permalink)
The Devil
 
blackpearl's Avatar
 
Join Date: Feb 2006
Location: 0x02AE88C6FF
Posts: 983
Question Need help in creating table in Mysql


I'm trying a template making engine called Template blocks, where the setup should create some tables in the database. But for some reason the tables are not created. I contacted support and they said i could manually create those tables. Now i know nothing about Mysql. Can somebody tell me the process and the commands I should give to create them? The tables are described in the file attached.
Attached Files
File Type: txt mysql.txt (3.9 KB, 1 views)
blackpearl is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 09-05-2008, 08:46 PM   #2 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: Need help in creating table in Mysql

1. Go to cPanel and create the database with name 'template_blocks'. If database is created proceed, to next step.
2. Go to phpMyAdmin and select the database that you just created.
3. Click on the 'SQL' tab.(refer to below figure)


4. Paste the below lines into the above shown textarea and hit 'go':
Note: I am not sure how it would work because variable 'TABLE_PREFIX' is not declared. To solve this issue, use the 'Find and replace function'. Replace '{{TABLE_PREFIX}}' with prefix of your choice or leave it blank.

Also I am doubtful about the last character in this code. Looks like some character encoding related problem to me. Please check that again.


Quote:
-- --------------------------------------------------------
--
-- Table structure for table `blocks`
--
CREATE TABLE IF NOT EXISTS `{{TABLE_PREFIX}}blocks` ( `id` int(11) NOT NULL auto_increment, `title` varchar(50) NOT NULL, `type` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `blocks`
--
INSERT INTO `{{TABLE_PREFIX}}blocks` (`id`, `title`, `type`) VALUES (1, 'header', 'HTML'), (2, 'topbar', 'PHP'), (3, 'sidebar', 'HTML'), (4, 'footer', 'HTML'), (5, 'styles', 'CSS'), (6, 'additional head', 'HTML');
-- --------------------------------------------------------
--
-- Table structure for table `sections`
--
CREATE TABLE IF NOT EXISTS `{{TABLE_PREFIX}}sections` ( `id` int(11) NOT NULL auto_increment, `title` varchar(50) NOT NULL, `slug` varchar(50) NOT NULL, `template` varchar(10) NOT NULL, `content` longtext NOT NULL, `position` varchar(4) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `sections`
--
INSERT INTO `{{TABLE_PREFIX}}sections` (`id`, `title`, `slug`, `template`, `content`, `position`) VALUES (1, 'Home page', 'index', '1', '<h2>A Sample Title</h2>\n\n<p>Welcome to your new website. This is some sample content entered just to jump-start in creating your website. Sorry if it looks too plain for your taste but the intention is to make it as easier to customize as possible.</p>\n\n<p>You will find some basic styles in the styles block that you can alter to your liking and there are also some other blocks there that create the tempalte you are viewing.</p>\n\n<p><a href="$Template_dir/admin.php">Login now to your administration and start editing</a></p>\n\n<p>More dummy text follows...</p>\n\n<p>Nulla mattis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut sem orci, egestas sed, pellentesque at, tempus ut, dolor. Aenean molestie feugiat tortor. Praesent in augue nec odio adipiscing consequat. Suspendisse ut nibh id mi venenatis vulputate. Nullam felis leo, faucibus eget, ullamcorper eu, porttitor et, felis. Aenean aliquam, arcu eu placerat elementum, ante sapien tempus quam, vitae feugiat est magna sed risus. Aenean elit nisl, rhoncus a, varius fermentum, congue nec, dui. Vestibulum lacus velit, auctor non, porttitor cursus, euismod non, ligula. Nullam dolor neque, scelerisque vitae, aliquam eget, porta quis, libero. Praesent diam quam, tempor non, ornare id, iaculis a, nisl.</p>\n\n<p>Proin ultricies ullamcorper nisl. Sed consequat rutrum turpis. Ut consectetuer orci scelerisque urna volutpat elementum. Aliquam interdum erat. Suspendisse tristique tempor ligula. Sed lobortis est sit amet massa. Nulla facilisi. Cras feugiat luctus sapien. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Ut elit pede, sollicitudin dignissim, fringilla a, facilisis ut, felis. Pellentesque nec velit. Donec lacus nulla, egestas ut, condimentum quis, volutpat non, dui. Praesent varius. In hac habitasse platea dictumst. Curabitur vitae odio. Maecenas risus. Maecenas vitae elit. Curabitur vitae leo eget justo convallis dapibus. In pede. </p>', '0(0)'), (2, 'About Us', 'about', '1', 'Sample text for the "about us" page', '0(1)'), (3, 'Contact', 'contact', '1', 'contact form...', '0(2)');
-- --------------------------------------------------------
--
-- Table structure for table `templates`
--
CREATE TABLE IF NOT EXISTS `{{TABLE_PREFIX}}templates` ( `id` int(11) NOT NULL auto_increment, `title` varchar(50) NOT NULL, `type` varchar(200) NOT NULL, `blocks` varchar(200) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `templates`
--
INSERT INTO `{{TABLE_PREFIX}}templates` (`id`, `title`, `type`, `blocks`) VALUES (1, 'Main', 'XHTML 1.0 Transitional', '5|6#1|2|3|X|4');
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Old 09-05-2008, 09:01 PM   #3 (permalink)
The Devil
 
blackpearl's Avatar
 
Join Date: Feb 2006
Location: 0x02AE88C6FF
Posts: 983
Default Re: Need help in creating table in Mysql

You mean I have to paste the whole contents into the SQL tab? The contents of the text file are the commands itself?

OK. I will try it. Thanks.
blackpearl is offline  
Old 09-05-2008, 09:09 PM   #4 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: Need help in creating table in Mysql

yes, they are the SQL commands. Give it a shot!

And don't the entire file., Paste only the code that I have quoted above.
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
new element in peridioc table :) chicha Chit-Chat 14 26-02-2008 09:12 AM
invalid partiton table thecreativeboy Software Q&A 1 20-10-2007 01:07 PM
Invalid Partition Table ???? DukeNukem Software Q&A 2 04-05-2007 10:17 AM
asking the most stupid Q : WHAT TO BUY PC TABLE . sugg plz reddragon Hardware Q&A 5 23-02-2006 09:38 PM
Partition table screwed up. rohandhruva QnA (read only) 2 27-12-2004 01:10 AM

 
Latest Threads
- by Sujeet
- by clmlbx
- by Sujeet
- by icebags

Advertisement




All times are GMT +5.5. The time now is 10:59 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2