$con = mysql_connect("IPaddress","name","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
return 0;
}
else
{
return $con;
}
//select database
mysql_select_db("databasename", $con);
$result = mysql_query("SELECT A FROM biaoming where ziduanming = '".bianliang."' ",$con);
while($row = mysql_fetch_array($result))
{
...............................
..........................
mysql_close($con);
}
mysql_query("set names 'GBK'");
mysql_query("INSERT INTO biaoming ( duan1,duan2,duan3...... ) VALUES('".bianliang1."','".bianliang2."','".3."'........)"))