0
<?php
$query = "SELECT bobot FROM `record_result` WHERE `participantid` = $idParticipant AND `questionid` = 1";
$query1 = "SELECT bobot FROM `record_result` WHERE `participantid` = $idParticipant AND `questionid` = 2";
$comments = mysql_query($query);
$comments1 = mysql_query($query1);
while($row = mysql_fetch_array($comments, MYSQL_ASSOC)) {
$bobot = $row['bobot'];
$bobot = htmlspecialchars($row['bobot'],ENT_QUOTES);
}
while($row = mysql_fetch_array($comments1, MYSQL_ASSOC)) {
$bobot1 = $row['bobot'];
$bobot1 = htmlspecialchars($row['bobot'],ENT_QUOTES);
}
?>
Ich möchte diesen Code kann bis 10 Schleifen. Ich hoffe, dass es nicht viele Variable, zB: $ query, $ query1, $ query2, ..., $ query10, $ Kommentare, $ comments1, $ comments2, ..., $ comments10, $ bobot, $ bobot1, $ bobot2, ..., $ bobot10. Jemand hilft mir, bitte ...Kann ich diesen Code in PHP mit for for oder while?
Danke mir geholfen, aber ich fand immer noch eine Fehlermeldung "Warning: mysql_fetch_array() erwartet Parameter 1 in bestimmten Ressource, boolean zu sein" auf Skript „while ($ row = mysql_fetch_array ($ Kommentare, MYSQL_ASSOC)) " –