Hello I have an array $name[] that I am trying to insert into the second field of my table but it's not working (table remains completely blank). I cannot find the error in my code what am I doing wrong?
$username="us";
$password="pw";
$database="db";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "error");
$i=0;
while ($i < 5) {
$query = "INSERT INTO table VALUES ('','$name[i]','','')";
mysql_query($query);
$i++
}
mysql_close();
Any ideas please? Thank you.