hvorfor virker mysql_num_rows ikke?
Fejlen:Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /customers/kr-data.dk/kr-data.dk/httpd.www/heroes/inside/dbconn.php on line 25
Koden:
<?
$p = "index";
if ($_GET["p"]) {
$p = $_GET["p"]; }
$page = "nopage.php";
$name = "Page not found";
$conn = mysql_connect("localhost", "kr_data_dk", "79WFXgt0") or die(mysql_error());
mysql_select_db("kr_data_dk") or die(mysql_error());
$strsql = mysql_query("select * from heroes_pages where alias = '$p'") or die(mysql_error());
while ($row = mysql_fetch_array($strsql)) {
extract($row);
}
$user = $_COOKIE["user"];
$pwd = $_COOKIE["tpswd"];
$lida = $_SESSION["lida"];
$lidb = $_COOKIE["lidb"];
$lidc = $_SESSION["lidc"];
$strsql = mysql_query("select * from heroes_users where user = '$user' and pswd = '$pswd' and lida = '$lida' and lib = '$lib' and lidc = '$lidc'");
if (mysql_num_rows($strsql) != 0) {
while ($row = mysql_fetch_array($strsql)) {
extract($row);
}
} else {
die ("Fejl i login, prøv igen. <a href=\"http://www.kr-data.dk/heroes/\">Tryk her for loginsiden!</a>");
}
?>
Håber i kan hjælpe
//Kr-data
