can anyone tell me wats wrong with this code

[php]
// db properties
define(‘DBHOST’,‘host’);
define(‘DBUSER’,‘user’);
define(‘DBPASS’,‘pass’);
define(‘DBNAME’,‘name’);

// make a connection to mysql here
$conn = mysql_connect (DBHOST, DBUSER, DBPASS);
$conn = mysql_select_db (DBNAME);
if(!$conn){
die( “Sorry! There seems to be a problem connecting to our database.”);
}
$sql = mysql_query(“SELECT Username, Email FROM sitelok WHERE Email=’”.$_SESSION[‘ses_slemail’]."’ AND Username=’".$_SESSION[“ses_slusername”]."’ ")or die(mysql_error());
$n = mysql_num_rows($sql);
if($n == $_SESSION[‘ses_slemail’]){} else {
linklokShowMessage($ErrorTemplate,“The email address provided does not match the email of the logged in user

Click your browsers BACK button and try again.”);
exit;
}

[/php]

You need to explain what is the problem you’re trying to solve, what error message you get etc. Depending on php settings in your environment, and depending on what you have in your linklokShowMessage() function, your code will or will not work.

Also look at this line…

$n = mysql_num_rows($sql);

The “$n” value will not equal the email address stored in SESSION

Sponsor our Newsletter | Privacy Policy | Terms of Service