Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hi friends,
i am using the following statements to display pictures and some inforamtion about the pictures.
i am using the statement in side the loop.Code: Select all
<?php
$result = mysql_query("SELECT * FROM pictures WHERE event_id!=0 AND enable='Yes' GROUP BY event_id ORDER BY picture_id DESC");
$result_all_rows = mysql_query("SELECT * FROM pictures WHERE event_id!=0 AND enable='Yes' GROUP BY event_id ORDER BY picture_id");
$totalrows = mysql_num_rows($result_all_rows);
if($totalrows)
{
$daily_pictures="<table width='99%' border='0' cellpadding='0' align='center' cellspacing='2' align='center' bordercolor='#C0C0C0'>";
$i=0;
while ($row = mysql_fetch_array($result))
{
$small_pic=$row['picture_small_url'];
$event_id=$row['event_id'];
$picture_id=$row['picture_id'];
$picture_date=$row['picture_date'];
$picture_caption=addslashes($row['picture_caption']);
$picture_caption1=str_replace('"','"',$picture_caption);
$picture_date_formate=date('jS F Y',strtotime($picture_date));
$query_sql=mysql_query("SELECT * FROM events,pictures WHERE events.event_id=$event_id AND maaking_pictures.event_id=$event_id");
$query_ret=mysql_fetch_array($query_sql);
$count_rows=mysql_num_rows($query_sql);
$i++;
if($i%3==1) $daily_pictures.="<tr>";
$daily_pictures.="<td>
<table border='0' align='center' id='picturebox'>
<tr>
<td align='center' class='darkgrey' colspan='3'>$eventName1 <span class='highlight'>[ $count_rows ]</span></td>
</tr>
<tr>
<td align='center' colspan='3'><img src='$small_pic'></td>
</tr>
</table>
</td>";
if($i%3==0) $daily_pictures.="</tr>";
}
$daily_pictures.="</table>";
}
else
{
$daily_pictures="<p class='error'>No Event Pictures Added Yet <p>";
}
echo $daily_pictures;
?>but, i want statement without using in the while loop statement.
can anybody help.
thanks,
qumar.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]