Hi all
If I have a loop
for ($i = 1; $i<=5; $i++){ for ($j = 1; $j<=5; $j++){ } }
How would I get the values of $i and $j into a mysql db
// Set up connection to mysql database up here
for ($i = 1; $i<=5; $i++){ for ($j = 1; $j<=5; $j++){ $sql = "insert into mytable (autoincrement_id,i_value,j_value) VALUES ('','$i','$j')"; $result = mysql_query($sql) or die ("broken query");
} }
Thank you very much that worked perfectly