Jump to content

[SOLVED] while($row = mysql_fetch_array($result))


johnwayne77

Recommended Posts

i have a classifieds system which i recently launched it.

 

i get each classified in the system by ---while($row = mysql_fetch_array($result))--- which loops until it reaches the end of the table

 

i really need to place ads in the classified page, let's say after 5 classifieds i need a banner placed

 

how can i halt loop to insert code then continue loop

 

any ideas?

 

 

Link to comment
Share on other sites

great... i'm not sure how to use the increment in the while because i have a smarty template.

 

i tried:

 

{php} $i = 1; {/php}

{foreach item=ad from=$ads}

{php} $i++ {/php} 

<tr class="{cycle values=",alt"}">

<td class="pointer"><a href="{$ad.LINK}" title="{$ad.TITLE|escape}">

{if $ad.SPECIAL}{/if}<b>{$ad.TITLE}</b></a> (<span class="pretrosu">{$ad.PRET}</span>) <br /> {$ad.DESCRIPTION|truncate:150:"...":true} - <a href="{$ad.LINK}" title="{$ad.TITLE|escape}">detalii...</a>{if $ad.SPECIAL}{/if}</a><br /></td>

 

<td><div align="center">{$ad.REGDATE}<br />

  {$ad.IMAGEYESNO}</div></td>

</tr>

{if $i == 5} <b>hi</b> 

{php} $i = 1; {/php}

{/if}

 

but no luck..

 

any advices?

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.