joxley1990 Posted July 8, 2007 Share Posted July 8, 2007 Hi guys, just joined because I have a question regarding PHP and MySQL databases. I want to make a website in which members can upload their own photo shopped work, and coded programs. But, to have a feature where members can join, and upload their own work, would I have to have some sort of database, because my server does not support databases, is there any way to do this without MySQL.. Thanks, James. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 8, 2007 Share Posted July 8, 2007 you can use flat files, but storing user information is always risky in flat files (and a challenge) alternativly you can probably get databasing somewhere else and if your host doesn't offer mysql find a better one cause most php host (almost all) give you mysql with it and its extremly cheap (<10$ a month) Quote Link to comment Share on other sites More sharing options...
joxley1990 Posted July 8, 2007 Author Share Posted July 8, 2007 Ok, thanks. I'm in the UK, and I wanted a local server, so they are about £8 a month.. Is there any way I can get a free database, and then point the website to that database, somehow? Quote Link to comment Share on other sites More sharing options...
trq Posted July 8, 2007 Share Posted July 8, 2007 What version of php does your server support? PHP5 comes standard with the sqlite database and extension. It would be worth checking anyway. Create a test script.... <?php phpinfo(); ?> Do you see any mention of sqlite? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 8, 2007 Share Posted July 8, 2007 try seeing if you can find a mysql only host somewhere else (don't know of one off hand sorry) but make sure your host allows you to first access databases not stored in their systems. Many times you can but just make sure before you commit. Users are always best in mysql because other wise you have to do a lot more work in querying flatfiles and its extremely slow. Not saying it can't be done but the structure of php would force your query to be more like a hide and seek match than a point and find (so to speak). If you go flat file you have to first come up with a delimeter system (most likely tabs and break lines) and then on every login read the file (the whole file...) break it apart into each row then into each field and find a match in the same line for password and username (a pain...) instead mysql can check logins on a simple 1 query This is the mysql version: <?php $q = "select field from table WHERE Username = $username && Password = $password"; $result = mysql_query($q) or die (mysql_error()); if(mysql_num_rows($result) >0) {//A match was found register sessions etc etc } else {//Not a valid login } ?> This is flat file: <?php $file = fopen($users, r); $rows= explode("\n",$file); foreach($rows as $value) { $temp = explode("\t", $value); if ($username == $temp[1] && $password == $temp[2]) { $userrow = $temp[0]; //ID $match = "yes"; break; } } if($match == "yes") {//login register sessions etc etc know its ID number thus you know its row number} Quote Link to comment Share on other sites More sharing options...
joxley1990 Posted July 8, 2007 Author Share Posted July 8, 2007 What version of php does your server support? PHP5 comes standard with the sqlite database and extension. It would be worth checking anyway. Create a test script.... <?php phpinfo(); ?> Do you see any mention of sqlite? http://www.the-web-pro.co.uk/tester.php Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 8, 2007 Share Posted July 8, 2007 sorry not seeing any mysql/pre defined databasing Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 8, 2007 Share Posted July 8, 2007 Joxley, I'm also in the UK and I use servers in the US. I pay $6.95 a month and I get 10 databases, 1.5GB HD space, 20GB bandwidth, unlimited subdomains and more. Quote Link to comment Share on other sites More sharing options...
prcollin Posted July 8, 2007 Share Posted July 8, 2007 Hi guys, just joined because I have a question regarding PHP and MySQL databases. I want to make a website in which members can upload their own photo shopped work, and coded programs. But, to have a feature where members can join, and upload their own work, would I have to have some sort of database, because my server does not support databases, is there any way to do this without MySQL.. Thanks, James. Email me i have a web hosting company. Its in the US but I will consider giving you a database reference you can use. I just need information on the business like name and type and all that jazz. Let me know. Email prcollin@gmail.com Quote Link to comment 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.