cyberfly 1 Report post Posted March 10, 2008 <?php $sql = 'select * from peserta, format_peserta, format WHERE peserta.idPeserta=format_peserta.idPeserta AND format.idFormat=format_peserta.idFormat'; $sql1 = mysql_query($sql) or die(mysql_error()); $sql2 = mysql_fetch_array($sql1); ?> ---------------------------------------- <td> <?php echo $sql2['idPeserta']; ?> </td> <td width="264" valign="top" class="style1"> <?php echo $sql2['namaPeserta']; ?> </td> <td width="131" valign="top" class="style1"><span class="style1"></span> <?php while($sql3 = mysql_fetch_array($sql1)) { echo $sql3['namaFormat']; } ?> </tdThe problem is like picture below.The Format data doesnt appear.It should display like this (based on the format that player choose):4berpasukantriodoublesingleThe format is entered using checkbox.data from checkbox is insert into table format_peserta,which is many to many table.column in table format_peserta is idFormat_peserta(PK,int,autoincr),idPeserta and idFormat.Can anyone tell me what is my mistake there?Sorry im quite new to php mysql.Ni gmbar database :P/s : nak reply bahasa melayu pn takpe.sori tak smpat nak translate Quote Share this post Link to post Share on other sites
Sama-Sama Belajar 0 Report post Posted March 23, 2008 if(format peserta==1){format=4berpasukan}buat coding macam ni pada scripting. Lagi senang. Quote Share this post Link to post Share on other sites