could not retrieve data from database
Posted: Wed Aug 19, 2009 9:40 pm
Hi,
I am making control panel. When the login is successful, i create a session to store email and use it validate every secure page. In the setting page, I have this code. I validate the user using email stored in the session and then use the same id to retrieve data from the database for display. I have one record in my database but some how every time, i query, it is giving me "QUERY WAS EMPTY" error. Please tell me where i am going wrong.
Thank you,
D
I am making control panel. When the login is successful, i create a session to store email and use it validate every secure page. In the setting page, I have this code. I validate the user using email stored in the session and then use the same id to retrieve data from the database for display. I have one record in my database but some how every time, i query, it is giving me "QUERY WAS EMPTY" error. Please tell me where i am going wrong.
Code: Select all
<?php
session_start();
if(ISSET($_SESSION['email'])){
$email = $_SESSION['email'];
// Opend database connection
include ("../inc/DBConnect.php");
// Execute database query
$validat="SELECT * from customer_data where email='$email'";
$validate2=mysql_query($validate) or die(mysql_error());
$validate3=mysql_fetch_array($validate2);
if(strlen($validate3[email]>0)){
$last_name = $validate3[last_name];
$mobile = $validate3[mobile];
$designation = $validate3[designation];
$company_name = $validate3[company_name];
$company_address = $validate3[company_address];
?>
HTML CODE for displaying records
<?php
Redirect code
?>
D