0

I'm planning to make a database for my wordpress website. It is to store (and retrieve) information about the products the members want to sell.

As far as i understand, i have to make the tables in wp database self. ( I'd used this source )

But i'm new in php and wp and i don't know how i can create tables in wp_database.

Thanks a lot!

  • Unless you have a very good reason, I would stay away from creating your own tables...Use custom post types instead. – user23654 Sep 1 '13 at 0:05
  • But i have a E-R schema that i want to implement. Is it possible to implement it via posts? – Asqan Sep 1 '13 at 0:09
  • Unless you are very good with PHP and MySQL, I'd stay away from creating your own tables. If you explain your project in more detail there may be a way to do this with Core functionality. – s_ha_dum Sep 1 '13 at 0:43
  • What i'm planning to do is a simple shopping-website. Each member can add products (but different categories and different attributes for each category of products) and again each member can search added products using the values of this attributes. Is it possible to create something like that without using database? – Asqan Sep 1 '13 at 13:47
  • wordpress.stackexchange.com/questions/96074/… maybe this helps you – helle Sep 1 '13 at 20:41
0

It may be a wrong approach, but without creating a plugin, one of my seniors, once did a WordPress Shopping Cart project by creating extra tables for her custom purposes. What she did is to follow the other existing tables in WordPress database.

Suppose what wp_posts table has by default is an ID. She opened up the structure of the table and see:

+=======+============+===========+============+======+=========+================+
| Field |    Type    | Collation | Attributes | Null | Default |      Extra     |
+=======+============+===========+============+======+=========+================+
|  ID   | bigint(20) |           |  UNSIGNED  |  No  |   None  | AUTO_INCREMENT |
+-------+------------+-----------+------------+------+---------+----------------+

Then she followed a similar things to her own table's ID's structure. And so on... And where necessary she made a new field with her personal choices.

It's her process— stealing structures from built-in WordPress db.

This was her methodology to the new table in WordPress for custom purpose. You can simply follow it or any other method proposed by any pro.

But being a newbie you should have to practice much with SQL & PHP first, it'll help you to understand its basics. All the very best.

  • Thank you for your answer. But, how exactly can i create a table in there? – Asqan Sep 2 '13 at 10:51
  • @Asqan: In localhost, from PHPMyAdmin you can easily create new table, if you are familiar with the interface before. A simple google can assist you on the way... :) – Mayeenul Islam Sep 5 '13 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.