php - Flipping active = -1 to active = 1 -
built this, , executed it, database in phpmyadmin has no changes... missing?
active column name in each table... there 107 tables need flip.
thanks.
<?php mysql_connect("localhost", "root", "789fernshb")or die("cannot connect server"); mysql_select_db("core")or die("cannot select db"); $sql = "show tables core"; $result = mysql_query($sql); $arraycount = 0; while($row = mysql_fetch_row($result)) { $tablenames[$arraycount] = $row[0]; $arraycount++; //only make sure starts @ index 0 } //print_r($tablenames); for($i=0;$i<sizeof($tablenames);$i++){ $table= $tablenames[$i]; echo $query = "update ".$table." set active=1 active=-1"; echo'>>'.mysql_query($query).'<br>'; } ?>
explicitely call mysql_error() function see happens. example in http://ca2.php.net/manual/en/function.mysql-error.php.
Comments
Post a Comment