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

Link to comment
Share on other sites

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>";

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

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