Jump to content

count rows


bleured27

Recommended Posts

got a problem whith counting rows php 5.3

error

Fatal error: Can't use function return value in write context in D:\xampp\htdocs\login.php on line 13

<?php 
session_start(); 
if(!empty($_POST['pass']) ||!empty($_SESSION['user']) ) 
{
$user=$_POST['name'];
$pass=$_POST['pass'];
mysql_connect('localhost', 'root', '') or trigger_error("Unable to connect to the database: " . mysql_error()); 
mysql_select_db('forum') or trigger_error("Unable to switch to the database: " . mysql_error()); 

$query="SELECT *  FROM users where user='$user' and pass='$pass";
$show=mysql_query("query");
$check_e = @mysql_query($query);
if(mysql_num_rows($check_e) =0)
{

echo"rong login";
session_destroy();
}}
else
{
$_SESSION['user'] = "$user"; 
$_SESSION['pass'] = "$pass"; 
echo"hoi";
include"home.php";
}
else{
echo"empty fields";
include"home.php";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/266326-count-rows/
Share on other sites

okey no error whith this only the page is white!!! idk how plz help

<?php 
session_start(); 
if(!empty($_POST['pass']) ||!empty($_POST['user']) ) 
{
$user=$_POST['name'];
$pass=$_POST['pass'];
mysql_connect('localhost', 'root', '') or trigger_error("Unable to connect to the database: " . mysql_error()); 
mysql_select_db('forum') or trigger_error("Unable to switch to the database: " . mysql_error()); 

$query="SELECT *  FROM users where user='$user' and pass='$pass'";
$show=mysql_query("query");
$check_e = @mysql_query($query); die(mysql_error());
if(mysql_num_rows($check_e) ==0)
{

echo"rong login";

}
else
{
$_SESSION['user'] = "$user"; 
$_SESSION['pass'] = "$pass"; 
echo"hoi";
include"home.php";
}}
else{
echo"empty fields";
include"home.php";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/266326-count-rows/#findComment-1364809
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.