foreverhex Posted July 10, 2006 Share Posted July 10, 2006 This is the second time Ive posted on the MySQL part of phpfreaks. Add Im really new at the SQL aspect of php. So help if you can please.I have a table. i want to be able to do a query where the url will say art.php?medium=photo , and it will show only photos instead of drawing ands what not. Not the table already has the rows set up, for this to work... I believe. Ive been researching this so I got a concept but its hard to find exactualy what you want if you dont know what its call. Also, how would you make it so that the return is in order by newest to oldest. Thanks for the help! Quote Link to comment Share on other sites More sharing options...
Wildbug Posted July 10, 2006 Share Posted July 10, 2006 First read the [url=http://dev.mysql.com/doc/refman/5.0/en/tutorial.html]MySQL tutorial[/url]. It'll take you through the basics. Also see [url=http://www.php.net/manual/en/ref.mysql.php]PHP's MySQL functions[/url].For your project you'll need to use the $_GET PHP superglobal to fetch the "?medium=photo" portion (I don't know if you knew that already). Your MySQL table, [i]at minimum[/i], will need a TIMESTAMP (or DATETIME) field, probably an ENUM field for the "drawing," "photo," etc. categorization, a VARCHAR field for the title, and, if you have user-submitted artwork, some level of unsigned integer to correlate to the user id.A query on your hypothetical table might look something like this:[code]SELECT * FROM artwork WHERE type='Photo' ORDER BY date;[/code]You also must decide if you want to store the image in the database or in a file on the server in which case you'll either need to store the filename or name the file according to the database entry's id. Quote Link to comment Share on other sites More sharing options...
foreverhex Posted July 10, 2006 Author Share Posted July 10, 2006 Yeah, I know the php elements of the project. It was just the pulling of the info I need. What you explained makes since. I going to read and then probably come back, lol. Thx 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.