Re: table loop problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Levi Scharf wrote:
> 
> You could try this. I'm not too sure if it'll work

> while ($query_detail = mysql_fetch_array($query_string))
> 
>                         {
> 
>                                     $Value1 = $query_detail["Value1"];
> 
>                                     $Value2 = $query_detail["Value2"];
> 
>                                     $Value3 = $query_detail["Value3"];
> 
>                                     $Value4 = $query_detail["Value4"];
> 
>                                     $Value5 = $query_detail["Value5"];
> 
>                                     $Value6 = $query_detail["Value6"];
> 
>                                     $Value7 = $query_detail["Value7"];
> 
>                                     $Value8 = $query_detail["Value8"];
> 
>  
> 
>                                     
> 
>             echo "<TR>\n";
> 
>             echo "(Create your first 4 table rows here. Remember to close
> off the table rows and cells.)\n";
> 
>             echo "(When you need to call something from the db it is done by
> a simple $Value1)\n";
> 
>             echo "<TD WIDTH=\"10%\" ALIGN=\"LEFT\"> </TD>\n";
> 
>             echo "<TD WIDTH=\"10%\" ALIGN=\"LEFT\"> </TD>\n";
> 
>             echo "<TD WIDTH=\"10%\" ALIGN=\"LEFT\"> </TD>\n";
> 
>             echo "<TD WIDTH=\"10%\" ALIGN=\"LEFT\"> </TD>\n";
> 
>                         }


This has a LOT of un-necessary code in it. There's no reason to assign 
the query results ($query_detail["Value8"] ) to a variable ($Value8) and 
then echo repetitive lines, when in PHP you can simply write the entire 
output to one string and echo that.
--------LDS--------LDS-------



PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

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

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

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




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux