Jump to content

[SOLVED] How to make this PHP-MySQL?


y2yang

Recommended Posts

Can anyone help me how to make MySQL store the information in red and use php to call upon it?

 

    <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;">

        <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;">

        <tr style="height:132px;">

            <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=56"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00004.jpg" style="border:solid 1px #ffffff;" alt=""  /></a></td>

        </tr>

        </table>

    </div>

   

    <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;">

        <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;">

        <tr style="height:132px;">

            <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=55"><img id="reSizeImg0" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00003.jpg" style="border:solid 1px #ffffff;" alt=""  /></a></td>

        </tr>

        </table>

    </div>

 

    <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;">

        <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;">

        <tr style="height:132px;">

            <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=54"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00002.jpg" style="border:solid 1px #ffffff;" alt=""  /></a></td>

        </tr>

        </table>

    </div>

   

    <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;">

        <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;">

        <tr style="height:132px;">

            <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=53"><img id="reSizeImg0" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00001.jpg" style="border:solid 1px #ffffff;" alt=""  /></a></td>

        </tr>

        </table>

    </div>

 

                <div style="clear:left;overflow:hidden;width:0;height:0;"></div>

                <p style="margin:20px;"></p>

                <div class="dotHLine1"></div>

                <p style="margin:20px;"></p>

                   

    <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;">

        <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;">

        <tr style="height:132px;">

            <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=52"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0502/zhaowei_05022009_s00000.jpg" style="border:solid 1px #ffffff;" alt=""  /></a></td>

        </tr>

        </table>

    </div>

   

    <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;">

        <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;">

        <tr style="height:132px;">

            <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=51"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0429/zhaowei_shopguide_04292009_s00001.jpg" style="border:solid 1px #ffffff;" alt=""  /></a></td>

        </tr>

        </table>

    </div>

   

    <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;">

        <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;">

        <tr style="height:132px;">

            <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=50"><img id="reSizeImg0" src="http://file.vickizhao.net/files/2009/0428/zhaowei_shopguide_04282009_sl00002.jpg" style="border:solid 1px #ffffff;" alt=""  /></a></td>

        </tr>

        </table>

    </div>

 

    <div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;">

        <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;">

        <tr style="height:132px;">

            <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=49"><img id="reSizeImg1" src="http://file.vickizhao.net/files/2009/0428/zhaowei_shopguide_04282009_sl00001.jpg" style="border:solid 1px #ffffff;" alt=""  /></a></td>

        </tr>

        </table>

    </div>

   

    <div style="clear:left"></div>

   

    <p style="margin:28px;"></p>

   

    <div class="BLine3"></div>

   

    <!-- paging -->

   

    <table width="100%">

    <tr style="height:33px;background:#f3f3f3;">

        <td class="tac vam"><span class="fs11"><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prevfirst.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" />  <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prev1.gif" class="vat" alt="PREV" style="margin: 2px;">  <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=1">1</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=2">2</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=3">3</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=4">4</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=5">5</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=6">6</a><span class="fs10 fc7">  /  </span><span class="b fs11 fc7">7</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=7">7</a>--><span class="fs10 fc7">  /  </span><span class="fs11 fc10">8</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=8">8</a>--><span class="fs10 fc7">  /  </span><span class="fs11 fc10">9</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=9">9</a>--><span class="fs10 fc7">  /  </span><span class="fs11 fc10">10</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=10">10</a>-->  <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /><!--<a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a>-->  <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_nextlast.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></span></td>

    </tr>

    </table>

 

The first part: Is to get my image url path. Each page id have 8 images.

The second part: How to make this hard coded paging into more auto.

 

If it help, the exact page i'm using the code on is at vickizhao.net/starhome/photo/list.php?Pid=7

 

Thank anyone for your time.

 

Sorry if I didn't put my code inside a code box but only way i can make what i wanted you to se ein red.

Link to comment
Share on other sites

<?php
$query = "..";
$result =  mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
?><div style="width:132px;height:132px;margin:0 5px 0 5px;float:left;">
        <table width="132" style="background:url('http://image.vickizhao.net/starhome/photo/list/img_pic_bg.gif') no-repeat;">
        <tr style="height:132px;">
            <td><a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/read/read.php?Pid=<?php print $row['id']; ?>"><img id="reSizeImg1" src="<?php print $row['imgpath']; ?>" style="border:solid 1px #ffffff;" alt=""  /></a></td>
        </tr>
        </table>
    </div><?php
}

?>

 

for this part:

 

<table width="100%">

    <tr style="height:33px;background:#f3f3f3;">

        <td class="tac vam"><span class="fs11"><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prevfirst.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" />  <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_prev1.gif" class="vat" alt="PREV" style="margin: 2px;">  <a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=1">1</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=2">2</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=3">3</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=4">4</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=5">5</a><span class="fs10 fc7">  /  </span><a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=6">6</a><span class="fs10 fc7">  /  </span><span class="b fs11 fc7">7</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=7">7</a>--><span class="fs10 fc7">  /  </span><span class="fs11 fc10">8</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=8">8</a>--><span class="fs10 fc7">  /  </span><span class="fs11 fc10">9</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=9">9</a>--><span class="fs10 fc7">  /  </span><span class="fs11 fc10">10</span><!--<a class="fs11 fc7" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=10">10</a>-->  <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /><!--<a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/starhome/photo/list.php?Pid=11" onfocus='this.blur();' style='text-decoration:none;'><img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_next1.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></a>-->  <img src="http://image.vickizhao.net/style_guide/icn/icn_starhome_nextlast.gif" class="vat" alt="NEXT" style="margin:2px; 0 0 0;" /></span></td>

    </tr>

    </table>

 

look at:

 

http://www.phpfreaks.com/tutorial/basic-pagination

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.