Archive: for

 

Posts Tagged ‘for’


If you find yourself laboriously building SQL queries by typing each field = 'value' statement... think again. Imagine this: PLAIN TEXT PHP: $sql_query = mysql_query("select * from table");   $insert_elsewhere_sql = "INSERT INTO other_table SET ";   while($s = mysql_fetch_assoc($sql_query)){     foreach($s as $k=>$v){     $insert_elsewhere_sql .= "$k = '$v', "; }   [...]