PHP DB

$dbc = mysql_connect($hostname,$username,$password);

mysql_close($dbc);

mysql_query('CREATE DATABASE mydb',$dbc);

mysql_select_db('mydb',$dbc);

$createtable = 'Creat Table MyTable(pro1 varchar(10))';

mysql_query($createtable,$dbc);

$var = mysql_real_escape_string($var,$dbc); //safe

mysql_query($insdata,$dbc);


$result = mysql_query($querySTATE,$dbc);

$row = mysql_fetch_array($result);

$row['name']


while ($row = mysql_fecth_array($result)) {

}

你可能感兴趣的:(PHP)