For guidance, database image output page

Source: Internet
Author: User
For more information, see database image output page. I have saved the image to the data. now I want to output the output page on the html page. three images are displayed on each page.
Database table is
Can you tell me the specific code? thank you!


Reply to discussion (solution)

Paging

$sqlstr = "select count(*) as recount from photo";$query = mysql_query($sqlstr) or die(mysql_error());$result = mysql_fetch_assoc($query);$recount = $result['recount'];$pagesize = 3;$page = isset($_GET['page'])? $_GET['page'] : 1;$offset = ($page-1)*$pagesize;$sqlstr = "select * from photo limit $offset, $pagesize";$query = mysql_query($sqlstr) or die(mysql_error());while($thread=mysql_fetch_assoc($query)){echo '';}


Show image
$id = isset($_GET['id'])? $_GET['id'] : 0;$sqlstr = "select * from photo where id='".$id."'";$query = mysql_query($sqlstr) or die(mysql_error());$result = mysql_fetch_assoc($query);if($result){header('content-type:'.$result['type']);echo $result['binarydata'];}


You can connect to the database by yourself.

Reference: http://blog.csdn.net/fdipzone/article/details/39915131

Thank you! I'm so excited that some beginners may not understand things for a long time. I still need to ask more.

Thank you! I'm so excited that some beginners may not understand things for a long time. I still need to ask more.



If the problem persists, close the post.


Thank you! I'm so excited that some beginners may not understand things for a long time. I still need to ask more.



If the problem persists, close the post.

Thank you. I have trouble figuring out the forum rules.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.