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.