Hi,

you would use a for loop like this:

$res2 = mysql_query("select name, address,city,state,country from  
college") or die ('I perform operation because: ' . mysql_error());
$count = mysql_num_rows($res2);


  for( $i=0; $i < $count; $i++)
     {
     $myrow =  mysql_fetch_assoc($res2);

     [insert echo for table structure and $res2[''] array for field  
refs]

     }

Mike
-- 
Mike Brandonisio                 *    IT Planning & Support
Tech One Illustration            *    Database Applications
tel (630) 759-9283               *    e-Commerce
[EMAIL PROTECTED]  *    www.techoneillustration.com

On Jun 30, 2005, at 6:58 AM, Mukesh Kumar wrote:

> Can Some body guide me wht to do
>
> I have a table name college
>
> and code is
>
> $res2 = mysql_query("select name, address,city,state,country from  
> college");
>
> ##  the result is 10 rows and the value can be used like
>
> while($myrow = mysql_fetch_row($res2))
> { ( $s .= '<tr><td>';
>  for($x=0; $x <= count($myrow)-1; $x++)
>   {$s .= $myrow[$x];}
>  $s .= '</td></tr>';
> }
> echo ('<table>'.$s.'</table>');
>
> But I want to use "for Loop"
>
> as I want to display information of three row from table in single  
> row of my output table.
>
> This can be done of course in while loop but I'm finding difficulties
> in placing colspan property value of td tag.
>
> How this informaton can be fetched with using For Loop
>
>
> Thank you,
>
> Mukesh
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> Community email addresses:
>   Post message: [email protected]
>   Subscribe:    [EMAIL PROTECTED]
>   Unsubscribe:  [EMAIL PROTECTED]
>   List owner:   [EMAIL PROTECTED]
>
> Shortcut URL to this page:
>   http://groups.yahoo.com/group/php-list
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>



Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to