PDA

View Full Version : Login Faild



ZFYL
02 Feb 2011, 04:19 PM
<?php

include_once "inc/mscon.php";
mysql_select_db("zfyl", $ddcon);
$result = mysql_query("SELECT nik,pas FROM 'zfyl' WHERE nik = '".$_POST["nik"]."'", $ddcon);
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);

$nikr = $row[0];
$pasr = $row[1];

if($_POST["pas"] == $pasr){
echo "Your Pass:".$pasr;
echo "Your Nick:".$nikr;

}

?>
echo "Your Pass:".$pasr;
echo "Your Nick:".$nikr;

}

?>

my problem in this script becouse it is dont work and write next

not selected databasae


for helping in undestand here the register form too


<?php
include_once "inc/mscon.php";

$na=$_POST["nik"];
$p98=$_POST["pas"];



//Create table
mysql_select_db("d2zfyl", $ddcon);


mysql_query("INSERT INTO zfyl
(nik, pas)
VALUES (".$na.", ".$p98.")",$ddcon);


mysql_close($ddcon);
echo "You succefully created the account. Your NICK NAME: ".$na." PASSWORD: ".$p98."";

?>

Jason
03 Feb 2011, 04:26 PM
What is the actual error that you are getting. You should check you are actually connecting to your database. You can then check your queries by doing this.


mysql_query('..') or die(mysql_error());

That will flag up errors with specific queries.