Jump to content

inserting data to table in my sql


shihabudheen

Recommended Posts

you should name your input boxes like this:

<table>

<tr>

<td><input type="text" name="t[1][1]" /></td>

<td><input type="text" name="t[1][2]" /></td>

<td><input type="text" name="t[1][3]" /></td>

</tr>

<tr>

<td><input type="text" name="t[2][1]" /></td>

<td><input type="text" name="t[2][2]" /></td>

<td><input type="text" name="t[2][3]" /></td>

</tr>

</table>

 

and your $_POST["t"] will be a multidimensional array (use

print_r($_POST["t"])

to see what it looks like) which you can iterate over and use to insert into the db

tx for reply..i want to create more than hundread textbox,so that giving name directly is to difficult.plz tell how can i create and give name to textbox using for loop..

<?php

echo "<table border=0>";

for ($j = 1; $j <= 40; $j++)

{

echo "<tr>";

for ($i = 1; $i <= 7; $i++)

{

echo "<td>";

echo "<input type=text name=t.[$j].[$i] >";//here getting mistakes :( :(

 

echo"</td>";

}

echo "</tr>";

}

echo "</table>";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.