26-11-2005, 01:35
|
|
|
חבר מתאריך: 03.01.05
הודעות: 840
|
|
לולאה בתוך לולאה... מעצבןןןןןןן עזרה
<?php
$dashim = "SELECT `id`, `name`, `dash` FROM `dashim` ORDER BY `id` DESC";
$result_dashim = mysql_query($dashim);
$replaces = "SELECT `w2replace`, `replacew` FROM `replaces`";
$result_replaces = mysql_query($replaces);
while($dash = mysql_fetch_array($result_dashim))
{ while($replace = mysql_fetch_array($result_replaces))
{
$w2replace = $replace['w2replace'];
$replacew = $replace['replacew'];
$dash['dash'] = str_replace($w2replace, $replacew, $dash['dash']);
}
echo("<b>".$dash['name'].":</b> ".$dash['dash']."<br />\n");
}
?>
הקוד הזה לא טוב משום שהוא מבצע את הלולאה השניה רק על הסיבוב הראשון של הלולאה הראשנה.. מקווה שהבנתם ותעלו על הבעיה ... תודה מראש
|