Jump to content
Sign in to follow this  
cyberfly

Nak View Checkbox Data (mysql)

Recommended Posts

<?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'];
 }
 ?>      
</td

problemge6.jpg

The problem is like picture below.The Format data doesnt appear.

It should display like this (based on the format that player choose):

4berpasukan

trio

double

single

The 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 :

dbif3.jpg

P/s : nak reply bahasa melayu pn takpe.

sori tak smpat nak translate :lol:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...