Kolusion Posted August 20, 2011 Share Posted August 20, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/245280-choosing-a-path-pseudo-php-database-or-mysql-database/ Share on other sites More sharing options...
Kolusion Posted August 20, 2011 Author Share Posted August 20, 2011 Double...... Quote Link to comment https://forums.phpfreaks.com/topic/245280-choosing-a-path-pseudo-php-database-or-mysql-database/#findComment-1259767 Share on other sites More sharing options...
MasterACE14 Posted August 20, 2011 Share Posted August 20, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/245280-choosing-a-path-pseudo-php-database-or-mysql-database/#findComment-1259788 Share on other sites More sharing options...
Kolusion Posted August 20, 2011 Author Share Posted August 20, 2011 I don't have time to learn every bit of PHP.. only the things I need. Why do you say MySQL for lots of items? Quote Link to comment https://forums.phpfreaks.com/topic/245280-choosing-a-path-pseudo-php-database-or-mysql-database/#findComment-1259795 Share on other sites More sharing options...
MasterACE14 Posted August 20, 2011 Share Posted August 20, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/245280-choosing-a-path-pseudo-php-database-or-mysql-database/#findComment-1259796 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.