我正在使用 WAMP 并编写了一个 php 脚本来连接到数据库我不认为这是代码,因为我得到一个错误,SCREAM: Error suppression ignored for
然后得到几个不同的错误,有人说:
Warning: mysql_connect(): MySQL server has gone away in C:\wamp\www\php.php
Warning: mysql_connect(): Error while reading greeting packet. PID=9044 in C:\wamp\www\php.php
Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\php.php
这是我的代码:
<?php
$con = mysql_connect("127.0.0.1:80",'user','');
if(!$con){
die( 'error:' . mysql_error());
}
$db = 'CREATE DATABASE db_one';
if(mysql_query($db,$con)){
echo 'data base created';
}
else {
echo 'Err:' . mysql_error();
}
$table = 'CREATE TABLE persons ( fname varchar (15),lname varchar(15), age int)';
mysql_query($table,$con);
mysql_close($con);
?>