我如何在PHP中创建警报 [英] how can i create alert in PHP
本文介绍了我如何在PHP中创建警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想提醒SQL错误消息,但是没有提醒.
I would like to alert the SQL error message, but alert is not coming.
"Access denied for user 'root'@'localhost'(using password: YES)"
是错误消息.
is the error message.
<head>
<title>Untitled Page</title>
</head>
<body>
<?php
$con=mysql_connect("localhost","root","123");
if(!$con)
{
$error=mysql_error();
echo "<script type='text/javascript'>alert(<?php echo $error; ?>);</script>";
}
?>
</body>
</html>
推荐答案
con = mysql_connect(" ," ," 123"); if(!
con=mysql_connect("localhost","root","123"); if(!
con) {
error = mysql_error(); echo "
error=mysql_error(); echo "<script type='text/javascript'>alert(<?php echo
这篇关于我如何在PHP中创建警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文