Jump to content

Rohit_Bhutani

New Members
  • Posts

    2
  • Joined

  • Last visited

Rohit_Bhutani's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks a lot for a prompt reply. Next time will use the code tags for sure. Even if I put a double qoute on variable (for the name field), its read as a string only and still I cant chose one option per row. Also if i cant echo in an echo, Is there any way to use these variables in the name and value field ?? There should be some way to use variables in these fields.
  2. Hello to all, I am new to this forum as well as php. Would highly appreciate if someone could help me on this: This is my code: $result = mysql_query("SELECT * FROM Users"); $num= mysql_numrows($result); echo " <table border='1'> <tr> <th>Username</th> <th>Can comment for you ?</th> </tr> "; echo '<form id="commentchoices1" name="form3" method="post" action="permissionsentry.php">'; while($row = mysql_fetch_array($result)) { if ($row['username']!= $_SESSION['SESS_USER_NAME']) //dont print the name of this user itself in the list comment for { echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>"; $var= $row['username']; $var2= $row['serial']; echo '<input name=$var2 type="radio" value= " . $var . " >Yes'; echo '<input name=$var2 type="radio" value="">No'; echo "</td>"; echo "</tr>"; } } The problem is with the radio buttons. I get the output clean and good with 5 rows of users. But the problem is that I want to be able to select "Yes" or "No" in each row but this output allows me to select only one radio button out of all of them. I kept the radio button name as the serial number of each user fetched from data base but still it doesnt work. Also value=value= " . $var . " is not working either. I get the output as ". $var ." only as if it was a string and not a variable. I know that I am doing in error in quotes and colons but I am not sure where. I have tried this also in value field: echo '<input name=$var2 type="radio" value= "<?php echo $var;?>" >Yes'; If I use echo '<input name=$var2 type="radio" value= '$var' >Yes'; I get a syntax error. But it does not give any output. May be because my statement is already in an "echo". Could anyone please help ? Thanks in advance. Regards, Rohit
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.