php Mysql for dummies and google got me going but now im stuck
the database is oke but i made a error in the query some where it needs to control if user and password combination exists
im puzzeling for 2 day's now and dont get it to run right.
when it runs it go's direct tho the ELSE statement
and display's the wrong blblblaaaaaa text
so my gues is i have the query wrong but cant figure out what.
any help would be great
the database is oke but i made a error in the query some where it needs to control if user and password combination exists
im puzzeling for 2 day's now and dont get it to run right.
when it runs it go's direct tho the ELSE statement
and display's the wrong blblblaaaaaa text
so my gues is i have the query wrong but cant figure out what.
any help would be great
PHP:
<title>Untitled Document</title>
</head>
<body>
<?php
// data base access
include('xxxx');
mysql_connect($host, $username, $password)or die(mysql_error());
mysql_select_db($database)or die(mysql_error());
$db_name="daktarie_GPRO";
$tbl_name="registered_members";
$name=$_POST['username'];
$password=$_POST['password'];
$sql = 'SELECT * FROM `registered_members` WHERE name=\'".$name."\' and password=\'".$password."\'""';
$result=mysql_query($sql);
if($count==1){
$_SESSION['username'] = $name;
$_SESSION['password'] = $password;
header("location:login_success.php");
}
else {
echo "<center><font size='5'>Wrong password or username";
}
?>
</body>
</html>