Photolisting Logic In PHP
<table width=”89%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”25%” valign=”top” class=”Body_Text”>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<?
$cntr = 1;
$qry = “select * from products”;
$indexbody=”;
$rs_qry = mysql_query($qry);
$num=mysql_num_rows($rs_qry);
while($fetch = mysql_fetch_array($rs_qry))
{
$pid = $fetch['product_id'];
$image = “../gallery/”.$fetch['image'];
$title = $fetch['title'];
if($cntr%4 == 1)
$indexbody.=’<tr>’;
$indexbody.=’<td align=”center” valign=”top” class=”Body_Text”><br><table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″><tr>’;
$indexbody.=’<td><img src=”‘.$image.’” mce_src=”‘.$image.’” width=”110″ height=”147″ class=”Border_Img” alt=”‘.ucwords($title).’”>’;
$indexbody.=’</td></tr><tr><td height=”30″ align=”center” valign=”top” class=”Text_ProductsBold”><br>’.ucwords($title).’</td></tr><tr>’;
$indexbody.=’<td align=”center” valign=”top”><input name=”submit” type=”submit” value=”Update” class=”but” style=”width:50px;” onclick=”setAction(\’edit\’);”> <input name=”submit” type=”submit” value=”Delete” class=”but” style=”width:50px;”/><br /></td></tr></table>’;
if($cntr == ($num-1))
{
if($cntr%4 == 0)
$indexbody.=’<td width=”25%” valign=”top” class=”Body_Text”></td><td width=”25%” valign=”top” class=”Body_Text”></td><td width=”25%” valign=”top” class=”Body_Text”></td>’;
if($cntr%4 == 1)
$indexbody.=’<td width=”25%” valign=”top” class=”Body_Text”></td><td width=”25%” valign=”top” class=”Body_Text”></td>’;
if($cntr%4 == 2)
$indexbody.=’<td width=”25%” valign=”top” class=”Body_Text”></td>’;
}
if($cntr%4 == 0)
$indexbody.=’</tr>’;
$cntr++;
}
echo $indexbody.”</table></td></tr></table><br>”;
No comments yet.
Leave a Reply
-
Recent
- Photolisting Logic In PHP
- IMP Javascripts Functions
- PHP And CURL
- Javascripts : get mouse position
- List Of good Site Name
- Multi Select Box to MySql DB Table
- php ini settings
- PHP – Make URLs clickable (And short down)
- List files in dir
- Tiny PHP Uploader
- Multi Select Box to MySql DB Table
- List files in dir
-
Links
-
Archives
- December 2007 (1)
- August 2007 (12)
-
Categories
-
RSS
Entries RSS
Comments RSS