Solved

Creating a database from excel for a wordpress site

Posted on 2014-11-10
6
201 Views
Last Modified: 2014-12-05
I would like to create a site like getapp, software advice, capterra, toptenreviews.

I have crawled the list of URLs on these sites to get a better understanding on how the site is structured.

I have sorted out the types of pages (vendor profile pages, category pages, search results page, alternative to page, comparison page, etc). I have a list of vendors for each category and a list of tags.  I have the entire list of URLs/pages and have grouped them according to the type of page.

I think wordpress might be the best solution to go for here. I would like to customize wordpress to make it do what is needed here.

I do have a few themes and plugins that would help out (like reviews, listings, comparisons, ratings, etc).

I have the entire database ready for use in an excel file.

A lot of these sites don't really have detailed information on these vendors. I went to each of the vendor's site and make sure that I got every single feature they have and more detailed info. I made a very through profile and comparison.

I would like to use this excel file for creating the backend (database) of the site that I am going to build.

How do I turn this into a database that can be used for a wordpress site?
0
Comment
Question by:smuralisankar
  • 2
  • 2
6 Comments
 
LVL 35

Assisted Solution

by:Kimputer
Kimputer earned 500 total points
Comment Utility
First get to know the database in wordpress (which one you need, what the current layout is). Then get the table/columns correct in excel (include header), then export in .csv file. In PHPMyAdmin import this csv file into your database table.
0
 

Author Comment

by:smuralisankar
Comment Utility
First get to know the database in wordpress (which one you need, what the current layout is).

What do you mean? What do I have to know?

The database is a mysql database.

Then get the table/columns correct in excel (include header), then export in .csv file.

When you say correct in excel, is there anything specifc that I have to do for this like best practices, precautions, naming conventions, etc?
0
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
Comment Utility
You think wordpress is a simple database, but it's not. It contains tens if not hundreds of tables. What you're trying to import, has to fit in the correct table, otherwise it's no use to import it in the first way. That's why I said you need to know which table you need, and what the column layout is. If you don't know, it's no use. It has no meaning to wordpress (and can have disastrous effect). After you know the database/table you need, and you know what it all means, you can try to make sense of it and build your excel file.

Here's for example a most common wordpress posts table:

CREATE TABLE `wp_posts` (
	`ID` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
	`post_author` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
	`post_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`post_content` LONGTEXT NOT NULL,
	`post_title` TEXT NOT NULL,
	`post_category` INT(4) NOT NULL DEFAULT '0',
	`post_excerpt` TEXT NOT NULL,
	`post_status` VARCHAR(20) NOT NULL DEFAULT 'publish',
	`comment_status` VARCHAR(20) NOT NULL DEFAULT 'open',
	`ping_status` VARCHAR(20) NOT NULL DEFAULT 'open',
	`post_password` VARCHAR(20) NOT NULL DEFAULT '',
	`post_lon` FLOAT NULL DEFAULT NULL,
	`post_lat` FLOAT NULL DEFAULT NULL,
	`post_date_gmt` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`post_name` VARCHAR(200) NOT NULL DEFAULT '',
	`to_ping` TEXT NOT NULL,
	`pinged` TEXT NOT NULL,
	`post_modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`post_modified_gmt` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`post_content_filtered` LONGTEXT NOT NULL,
	`post_parent` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
	`guid` VARCHAR(255) NOT NULL DEFAULT '',
	`menu_order` INT(11) NOT NULL DEFAULT '0',
	`post_type` VARCHAR(20) NOT NULL DEFAULT 'post',
	`post_mime_type` VARCHAR(100) NOT NULL DEFAULT '',
	`comment_count` BIGINT(20) NOT NULL DEFAULT '0',
	PRIMARY KEY (`ID`),
	INDEX `post_name` (`post_name`),
	INDEX `post_status` (`post_status`),
	INDEX `type_status_date` (`post_type`, `post_status`, `post_date`, `ID`),
	INDEX `post_parent` (`post_parent`),
	INDEX `post_author` (`post_author`)
)
COLLATE='latin1_swedish_ci'
ENGINE=MyISAM
AUTO_INCREMENT=1800;

Open in new window


So make the headers in your excel, and fill it with your data, matching the types (text/numbers/etc) and contraints (max 20 chars etc?), then try the import, and hope it doesn't fail (because of wrong type/constraint/data).
This is just an examle! The table you need might look totally different. You need to fully understand your database, otherwise it's no use. A database doesn't magically know what you want or need. As you are using various plugins and themes, they might use other tables to put their data in. I cannot know where you need to put the relevant data.
Maybe it's best you look at the plugins and see if they have specific import functions, that would make more sense than you importing it straight into the database.
0
 

Author Comment

by:smuralisankar
Comment Utility
No. It is not a duplicate. The explanation of the project is the same since it is the same project. But please check the end of the question. One deals with the importing of data from a CSV and creating a database. The other deals with bulk creation of pages based on data (csv or database).
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There is a huge demand for CodeIgniter among the PHP web developers due to its dynamic features and benefits these days. It is one of most popular and agile open source PHP framework for creating robust web applications in PHP web development field.…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now