Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (14 sloc) 614 Bytes
<?php
define(DB_HOST,'localhost');
define(DB_NAME,'candidatos2010');
define(DB_USER,'root');
define(DB_PASS,'');
$conn = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die ("<br><br><center>Problemas ao conectar no servidor: " . mysql_error() . "</center>");
mysql_select_db(DB_NAME);
$sql = 'select * from candidatos_bens';
$q = mysql_query($sql);
while($rs = mysql_fetch_array($q)) {
$sql_temp = 'insert into candidatos_bens_temp values (' . $rs['idCandidato'] . ',' . $rs['idBem'] . ",'" . trim($rs['valor']) . "')";
mysql_query($sql_temp) or die(mysql_error().'--'. $sql_temp);
}
?>