Chamza Posted July 30, 2009 Share Posted July 30, 2009 Hello everyone, I don't know much about MySQL, but if it is needed for my project I am willing to learn it. I am making a website like StumbleUpon.com, and I have pretty much created the site. Basically, I have thousands of links stored within each category, and when a button is pressed, a random link from the category that is chosen will be displayed. Currently, I have these links in a PHP array, which not only makes it difficult to modify the links, but when the user views the page source, they can see all the links (which i dont want) All i know about MySQL is that its a database, and I was wondering if storing the links within mySQL was possible, and if it is possible, how would I go about doing it? Furthermore, how do i connect it with my php array? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/168196-does-my-project-need-mysql/ Share on other sites More sharing options...
rhodesa Posted July 30, 2009 Share Posted July 30, 2009 Does my project need MySQL? No project NEEDS MySQL. There are a lot of reasons to use it, but never feel like you have to use it. Currently, I have these links in a PHP array, which not only makes it difficult to modify the links For something simple like this, just keeping the links in a file might be easier. Putting them into MySQL won't make them any easier to edit. You would still need to create some sort of front end interface for managing them. but when the user views the page source, they can see all the links (which i dont want) If they are in a PHP array, the user shouldn't be able to View Source and see the entire list... All i know about MySQL is that its a database, and I was wondering if storing the links within mySQL was possible, and if it is possible, how would I go about doing it? Furthermore, how do i connect it with my php array? Thanks. If you want to keep it simple, stick with a flat file. If you want to start tracking anything else though (like visits, popularity, users, etc) you will probably want to start using some sort of database (MySQL being the most commonly used). To help you get started, check out this (specifically PHP 101 (PART : Databases and Other Animals) http://devzone.zend.com/node/view/id/627 Quote Link to comment https://forums.phpfreaks.com/topic/168196-does-my-project-need-mysql/#findComment-887100 Share on other sites More sharing options...
Chamza Posted July 30, 2009 Author Share Posted July 30, 2009 Thanks for the quick reply. Haha, sorry for all the assumptions, most notably but when the user views the page source, they can see all the links (which i dont want) It is a relief to hear that they cant, that was my primary concern. Quote Link to comment https://forums.phpfreaks.com/topic/168196-does-my-project-need-mysql/#findComment-887105 Share on other sites More sharing options...
rhodesa Posted July 30, 2009 Share Posted July 30, 2009 I mean...they won't be able to unless you echo the entire array out. The source for the PHP file you see is not what the user can see. The easiest way to understand is just do it, write a script and then load it up and do a View Source on the page. It only shows what PHP tells it to show. Quote Link to comment https://forums.phpfreaks.com/topic/168196-does-my-project-need-mysql/#findComment-887164 Share on other sites More sharing options...
DaiLaughing Posted July 31, 2009 Share Posted July 31, 2009 I would argue that your project at least deserves MySQL. You are going to want to record which user has visited which site or they will be sent back there again. You are going to want user accounts so the user can choose categories and then you need to remember those categories. Presumably you will want some sort of thumbs up and down system and again those need to be stored. A relational database allows all that to be added when you implement it. Quote Link to comment https://forums.phpfreaks.com/topic/168196-does-my-project-need-mysql/#findComment-887474 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.