php, html Table with a checkbox

Hi i want to show a table with a 3 columns -

  1. Select option column [a Checkbox (that will be on the second row-will be repeating according to the results)]
    2)Client ID column
    3)Client Name column

and a button named ‘SHOW’

for now i made the table.
[php]

Untitled Document <?php $username="root"; $password=""; $database="sd"; //connect to sever $connect = mysql_connect("localhost",$username,$password) or die("sever doesn't exist"); //connect to database mysql_select_db("sd") or die("database doesn't exist"); //creating a table echo"
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
Select Client_ID Client_Name
" . "" . "" . "" . "" . "
"; ?> [/php]

my question is why is my check box and a text box isnt showing when i have already put it…can anyone help.Please… :slight_smile: where am i wrong?

Hi,
I think you forget to put ‘input’ fields in your HTML and instead put ‘tr’ fields there. Which doesn’t really work. :wink:

[php]

[/php]

You also seem to put a lot of empty 'td’s inthere. ‘td’ is the table cell element, everything you put in a table you put in those.
In ‘tr’ elements you can only put ‘th’ and ‘td’ elements. ;D

Hope it helps,
enfin, good luck!

O.

Thanks but i made it with a with a radio button.have 2tables rather than 1.but only 1st table shows… why is that?
there is no errors showing… so i don’t know what is wrong…:frowning:

[php]

Untitled Document <?php $username="root"; $password=""; $database="sd"; //connect to sever $connect = mysql_connect("localhost",$username,$password) or die("sever doesn't exist"); //connect to database mysql_select_db("sd") or die("database doesn't exist"); //creating a table echo "
Client ID &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
Client Name &nbsp&nbsp&nbsp <input type=submit name=SHOW value='SHOW' onclick=\"location='content.php'
"; echo "
Select Client ID Client Name Address Telephone Fax
Home
"; ?> [/php]

I can see both the tables. Also can see checkbox. I just re aligned the code just check it and let me know what exactly you want to do:
[php]

Untitled Document
<tr>
<td align='left'>
	Client Name &nbsp&nbsp&nbsp 
	<input name='ClientName' type='text' size='50' maxlength='50'></td>
<td id='buttons' align= 'left'>
	<input type=submit name=SHOW value='SHOW' 	onclick=\"location='content.php'</td> 
</tr>
</table>
Client ID &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
Select Client ID Client Name Address Telephone Fax
Home
[/php]

[php]also put below code after the tag <?php
$username=“root”;
$password="";
$database=“sd”;
//connect to sever
$connect = mysql_connect(“localhost”,$username,$password) or die(“sever doesn’t exist”);
//connect to database
mysql_select_db(“sd”) or die(“database doesn’t exist”);
//creating a table
?>
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service