<?php include("include/config.php"); $sql=dbFetchArray(dbQuery("SELECT * FROM table_from"),MYSQL_BOTH); $sql1=array($sql); $a = stripslashes($sql['a']); $b = stripslashes($sql['b']); $c = base64_decode(stripslashes($sql['c'])); $md5pass = md5(['d']); $e = stripslashes($sql['e']); $f = stripslashes($sql['f']); $g = stripslashes($sql['g']-1); $h = stripslashes($sql['h']); $i = stripslashes($sql['i']); $j = '1'; dbQuery("insert into table_to(a, b, c, d, e, f, g, h, i, j, k) values('$a','$b','$md5pass','$c','$d','1','$e','$f','$g','$h','$i')"); ?> PHP: this script copies one record from "table_from" to "table_to" there are more then 1000 records how can i copy all from table_from to table_to
i do it as $i=$sql1; // while($i<='1') while($i<=1) { dbQuery("insert into table_to(a, b, c, d, e, f, g, h, i, j, k) values('$a','$b','$md5pass','$c','$d','1','$e','$f','$g','$h','$i')"); ?> $i++; } PHP: it do not take any action and do not give any error "script runs without error but no results"
maybe but not sure where i put it while($i<=1) then it copies 1 record from one table to two and while trying for second record it says "Duplicate" echoing copied record it means my while loop tries to copy same record again