So far, I'm only working on the first 2 columns, Placeholder and English Text.

//Placeholder
$query_ph = "SELECT ph_name from placeholder";
$result_ph  = mysql_query($query_ph) or die('Query failed:'.mysql_error());

//English Text
$query_en = "SELECT text from content WHERE lan_id=1";
$result_en = mysql_query($query_en) or die('Query failed:'.mysql_error());
?>

    Nested Loops??

    Date: 12/23/06 (PHP Community)    Keywords: php, mysql, html, sql

    Hi everyone, I'm a bit confused with PHP While Loops. =/

    Currently, I want to echo a table that has 4 columns, "Placeholder (ph_name)", "English Text (text)", Foreign Text (text area)", "Action (save)". 

    When I view the page, the table cells are all jumbled up.

    the html codes should look like that:

ph_nametexttext areasave

 
// Get each row of data on each iteration until there are no more rows

while($row_ph = mysql_fetch_array($result_ph)){
echo "";
echo "";

          while ($row_en = mysql_fetch_array($result_en)){
               echo "";
}
}
?>
PlaceholderEnglish TextForeign TextAction
";
echo $row_ph['ph_name'];
echo "
";
               echo $row_en['text'];
               echo "


How should I nest the loops? 
Thanks! (:

x-posted to '[info]'php_mysql

Source: http://community.livejournal.com/php/525071.html

« Instantiating object by... || gd library »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home