【发布时间】:2013-10-20 16:31:58
【问题描述】:
根据第 14 行的标题,我收到一个错误。我对 php 很陌生,我登录了,这段代码在登录到索引页面时抛出了一个错误。不过我可以登录(不太确定如何登录)。
<?php
include 'functions.php';
include_once("config.php");
session_start();
if(!isset($_SESSION["email"])){
header("location: login.php");
exit();
}
$id = preg_replace('#[^0-9]#i', '',$_SESSION["id"]);
$email = preg_replace('#[^A-Za-z0-9]#i', '', $_SESSION["email"]);
$password = preg_replace('#[^A-Za-z0-9]#i', '', $_SESSION["password"]);
include "db_connect.php";
$sql=mysql_query("SELECT * FROM 'members' WHERE id - ? LIMIT 1"); // query the person
$existCount=mysql_num_rows($sql); // count the nums
if ($existCount==1){//evaluate the count
echo "Your login session data is not on record in the database";
exit();
}
?>
【问题讨论】:
-
如果没有看到您的代码,我们将无法提供帮助。
-
谷歌你的错误信息,然后咨询
mysql_error()。 -
我已经编辑过了,抱歉
-
请参阅this answer 了解如何解决此问题。
-
你不应该使用 mysql_* 函数。