Jump to content

Choosing a path - pseudo-PHP database or MySQL database?


Kolusion

Recommended Posts

At the moment  I am creating a search function for my website.

The approach I have in mind is a pseudo-PHP database. To give an example:

 

A HTML form will submit the results to a PHP file.

 

HTML FORM - Colour: Black

PHP RESULT PAGE - if ($_POST['color'] == 'Black') {readfile("./products/black/*.html");}

HTML FORM - Price: <$50

PHP RESULT PAGE - if ($_POST['Price'] == '<$50') {readfile("./products/less50/*.html");}

 

The problem here is if there is an item that is black and costs less than $50, then its going to be listed twice. There is probably some code I can write to ommit the listing of duplicate entries, but it is probably going to be messy, so I am wondering if its better to use a centralized MySQL database, rather than a pseudo-PHP database? I've never used MySQL and don't know much about it and this is my first real attempt at using PHP.

Link to comment
Share on other sites

maybe you should grasp the basics of PHP first, then decide on how you're going to accomplish this task. Whether or not you will need to use a MySQL database is up to you. If you have a hell of a lot of items then it'd be ideal and convenient, and learning SQL isn't the end of the world. Here's a good place to start... the PHP Manual

Link to comment
Share on other sites

I don't have time to learn every bit of PHP.. only the things I need.

maybe you should grasp the basics of PHP first

 

The problem here is if there is an item that is black and costs less than $50, then its going to be listed twice. There is probably some code I can write to ommit the listing of duplicate entries, but it is probably going to be messy

 

...

 

Why do you say MySQL for lots of items?

I don't know how many 'items' you have to check, nor do I know why you need to check them. From the information you've provided it sounds like the kind of thing you're looking for.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.