I have the insert part that inserts a single line. However I would be interested in getting it to repeat into the database 10 rows in a row. Example what I am getting a b c d f e e f e what I want to do ... a b c a b c a b c a b c a b c a b c a b c a b c a b c d f e d f e d f e d f e d f e d f e d f e d f e d f e e f e e f e e f e e f e e f e e f e e f e e f e e f e e f e My code ( I tired for inside a for but no luck.. ) Any pointers or suggestion is appreciated. for($i=0;$i<count($this);$i++) { // $n = 1; //while ($n <= 10) { echo $h=$this[$i]; echo$i= $fly[$i]; $q = "INSERT INTO start (`yes`, `so`) VALUES ('$h', '$i')"; $r = mysqli_query ($dbconnect, $q) or die ("Update query failed : " . mysql_error()); } PHP:
First of all, you shouldn't use un-prepared queries, but ok - as for the question, you should be able to do this by doing something like this: for ($i = 0; $i < count($this); $i++) { $h = $this[$i]; $i = $fly[$i]; for ($c = 1; $c <= 10; $c++) { $q = "INSERT INTO start (`yes`, `so`) VALUES ('$h', '$i')"; $r = mysqli_query ($dbconnect, $q) or die ("Update query failed : ". mysql_error()); } } PHP:
You are fantastic.. Thank you I was so close but yet so horribly far. I had the for but with $i and in the wrong spot .. Yea I know about the prepared.. This is just for something I am running inside.