Database Appliction

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Database Appliction

Post by Vegan »

OK I have an idea. I have a database of UPC codes, all of them, millions of rows. No problem but why can't I stuff it into the MySQL and search based on UPC and then add columns of data that is of interest.

So I see the need for a loader to get the CSV into MySQL, and a form for editing the row and inserting any information users might contribute.

There is an update for the UPC list, so iserting the difference is needed to keep it up to date.

The UPC datasbase should be separate from the other tables and a relation used. This way other projects can use the UPC database for an entirely different application.

How much work is this? And is there any code examples around this concept that could act as a reference/starting point?
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Database Appliction

Post by AbraCadaver »

Shouldn't be that difficult. You can use the MySQL 'LOAD DATA INFILE' to import the data. I would use the CakePHP framework for something like this to get up and running quickly. If you design your database/tables/keys according to cake conventions then the app almost builds its self. I'm pretty sure you can use the 'LOAD DATA INFILE' to update the existing data as well.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: Database Appliction

Post by Vegan »

The sounds attractive, the reason I wanted to have separate databases is for different web sites to use the database for different purposes.

The UPC database is *.* while I use one subset for one site and another subset for another. Is this going to be tricky or can this be simple.
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Database Appliction

Post by AbraCadaver »

Vegan wrote:The sounds attractive, the reason I wanted to have separate databases is for different web sites to use the database for different purposes.

The UPC database is *.* while I use one subset for one site and another subset for another. Is this going to be tricky or can this be simple.
It is easy to join tables from different mysql databases, but I would probably go with different tables in the same DB. You can give the sites that need restricted access a restricted mysql username, or if they aren't under your control (external sites) you can code a script that takes input from another site and returns the results in XML, expose it as a web service.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: Database Appliction

Post by Vegan »

Sounds like I need to look closely at the design of the various uses that I want. I will post a schema once I have a clearer picture of the ideas in mind.

Right now I am still looking at options, and I am using Amazon for some of the services I use.
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply