好的,这个代码应该显示用户名,然后显示注册用户的数量。所以我的问题是显示用户名但不会显示用户数量。我不断收到此错误。
Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/68/10509868/html/login-home.php on line 147
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/68/10509868/html/login-home.php on line 147
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
这是我的有效代码。
欢迎回来<?= $fgmembersite->UserFullName(); ?>
!
这是我的代码,似乎不起作用 我们有
<?php
$sql = mysql_query("select * FROM users")or die(mysql_error());
$nrows = mysql_num_rows($sql);
echo $nrows;
?>
现在注册用户!
这就是我连接到我的数据库的方式
<?php
$con=mysqli_connect("host IP","username","password");
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>