Skip to content
Advertisement

PHP echo/print value on for every 4th loop (start of count is 0)

How do i echo a value for each certain loop (4th) if my starting count number is 0? For example, the count is 0,1,2,3,4,6,7,8,9,10,11,12,13

I need it to echo/print on the following numbers: 3,8,12,16

Here’s my loop codes:

JavaScript

It kind of works but unfortunately, it starts printing the $VALUE on #0

So it prints on the following count/numbers: 0,4,8,12

Instead of the correct ones: 3,8,12,16

Advertisement

Answer

Try this:

$Num_Rows = mssql_num_rows($query);

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement