Data MySQL server picture
Want to upload images to the server, with MySQL storage address, there are 1000来 pictures, randomly find a few in the foreground display.
I really can not write, how a train of thought ah? Online search also know what keywords to search, the great god to help?
Reply to discussion (solution)
A simple random number on the line. is also the best way. You want to be all random, then use in.
I think it's possible to get a few random numbers in the program and then bring it to MySQL to query.
Ideas, first in the background to do a upload upload, and then the picture path to the database, the front desk can be directly adjusted.
1. First of all, you should upload the picture! Don't look at this video tutorial (http://www.php100.com/html/shipinjiaocheng/PHP100shipinjiaocheng/2009/0416/808.htm)
2. Image address into the database, not the same to see the tutorial
3. Randomly take a few pictures, such as 12, SQL can write this:
SELECT * from ' table ' ORDER by rand () limit 12
1. First of all, you should upload the picture! Don't look at this video tutorial (http://www.php100.com/html/shipinjiaocheng/PHP100shipinjiaocheng/2009/0416/808.htm)
2. Image address into the database, not the same to see the tutorial
3. Randomly take a few pictures, such as 12, SQL can write this:
SELECT * from ' table ' ORDER by rand () limit 12
404 errors, do you have any other tutorials?
PHP File Upload
Http://www.w3school.com.cn/php/php_file_upload.asp
MySQL query statements are http://www.3lian.com/edu/2013/03-01/58619.html that support random queries.
If there is no requirement for the query rate, ORDER by RAND () is recommended because it is relatively simple