ok, well here is how i usually do this. first you connect to the database:
Code:
$database="localhost";
$datauser="username";
$datapass="password";
$conn=mysql_connect("$database", "$datauser","$datapass");
and i leave that at the top of my page. now do make a sql query you can just do this:
Code:
$sql="select * from <table>";
$result=mysql_query($sql);
;
now that way you can test to see if its been inputted or not. $result will be given a true if it was succesful or a false if not. so you can just use a simpel if then statement to output to the screen if it was all good or not.
so, assuming that you are connecting to the database correctly, the reason you aren't getting things entered in is because your sql syntax is wrong.
the sql syntax for entering something into a table is
Code:
insert into table_name (column list) values (item list)
so you need to change your syntax to say
Code:
$sql2="INSERT INTO $tb_name ($infield) VALUES ($form_array[$i])
you may need to put single quotes around $form_array[$i] if its a phrase (or the table is expecting a phrase i.e. its a column of type varchar, or text, or something along those lines).
so long post short, you just need to add the word values.