Jump to content

Recommended Posts

ok. I have this:

while($row = mysql_fetch_array( $result )) {
echo "<tr><td>"; 
echo " ".$row['user_name']." ";
echo "</td><td>"; 
echo " ".$row['user_facility']." ";
echo "</td><td>"; 
echo " ".$row['user_position']." ";
echo "</td><td>"; 
echo " ".$row['user_email']." ";
echo "</td><td>"; 
echo " ".$row['user_contact']." ";
echo "</td><td>"; 
echo " ".$row['update_date']." ";
echo "</td><td>"; 
echo "   <a href=\"index.php?page=edit-a-user&id=".$row['user_id']."\">edit</a>   " ;
echo "</td></tr>";

 

which works GREAT! I want to now use the above code, but instead of fetching the array, I want to echo the above table as many times as and integer. For instance; if the integer inside of the variable is 189 ($theInt = 189) the repeat that row from above 189 times and include dynamic number row as well.. . .  see below for the row explanation:

 

echo " ".$theInt + 1;
echo "</td><td>"; 

 

so I would like the above code print  the number for each time it builds a row. . . . does this make sense.?

Link to comment
https://forums.phpfreaks.com/topic/62784-repeat-rows-plus-add-a-number/
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.