当我尝试运行此代码时,我的网站处于托管状态,内容消失了,此代码有什么问题?还有其他显示下面代码结果的方法吗?
<?php
session_start();
$db = mysqli_connect('localhost', '******', '*******', '********'); //db connection is correct
$sql = "SELECT name, email FROM users WHERE username = '" . $_SESSION['username'] . "' ";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
echo "Hello, " . $row['name'] . " (" . $row['email'] . ").";
?>
答案 0 :(得分:0)
在代码中使用mysqli函数:
"/mypath/tab-a"