";mysql_select_db($dbdatabase, $link) or die('Could not select database.');//MySQL查询语句$sql="SELECT * FROM ".$tablename;//MySQL插入语句$ins="insert into ".$tablename." values('5','thgf','中午','','','')";//执行插入语句mysql_query("set names utf8");mysql_query($ins);//执行执行语句,获取数据库中数据mysql_query("set names utf8");$result=mysql_query($sql,$link);echo $result;echo "";//输出查到的内容while($row = mysql_fetch_row($result)){ foreach($row as $val){ echo '--'.$val; } echo ''; } //4、关闭资源 $row->free(); mysql_close();?>