Dreamweaver中要怎样与MYSQL数据库连接
展开全部
在代码最上面写上
<?php
$dbh
=
mysql_connect('localhost:3306','mcclain','standard');
mysql_select_db('admreqs');
$query
=
"insert
into
requests(date,
request,
email,
priority,status)
values
(NOW(),'$description',
'$email',
'$priority',
'NEW')";
$res
=
mysql_query($query,
$dbh);
$query
=
"select
max(id)
from
requests";
$res
=
mysql_query($query,
$dbh);
$err
=
mysql_error();
if($err){
echo
"发生错误,请通知<a
href=mailto:webmaster@my.site>站长</a>";
}
$row
=
mysql_fetch_row($res);
echo
"未来您使用的号码为:
".$row[0];
?>
<?php
$dbh
=
mysql_connect('localhost:3306','mcclain','standard');
mysql_select_db('admreqs');
$query
=
"insert
into
requests(date,
request,
email,
priority,status)
values
(NOW(),'$description',
'$email',
'$priority',
'NEW')";
$res
=
mysql_query($query,
$dbh);
$query
=
"select
max(id)
from
requests";
$res
=
mysql_query($query,
$dbh);
$err
=
mysql_error();
if($err){
echo
"发生错误,请通知<a
href=mailto:webmaster@my.site>站长</a>";
}
$row
=
mysql_fetch_row($res);
echo
"未来您使用的号码为:
".$row[0];
?>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询