I have a form which dynamically creates new fields if the user wishes to. I am using post to retrieve all the values. However, I want to store and display all these values in a single column in a MySQL table.
What I did was create an array to store all these values. However I'm getting an error. Is this possible what I'm doing?
Storing post values in array:
$person1english[]=array("$english1","$english2","$english3","$english4","$english5","$english6","$english7","$english8","$english9","$english10");
$connect=mysql_connect('localhost','root','');
$db=mysql_select_db('conversationmaker');
if($connect)
{
$sql="insert into relation(english_atom) values('$person1english');
$query=mysql_query($sql);
if($query)
{
$sql="SELECT * FROM relation";
$query=mysql_query($sql);
if($query)
{
echo "<table border=1>";
echo "<tr><th>English</th><th>Sanskrit</th></tr>";
while($row=mysql_fetch_array($query))
{
echo "<tr>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "</tr>";
}
echo "</table>";
}
}
}
}
I am only working with English atm so you can ignore the row 2 that you see.