franknu Posted May 26, 2007 Share Posted May 26, 2007 Ok, This here should work, i've done this many times. i just dont see the problem now after the user verify him/herself i want to display the data which is in his/her row. the problem is that after it veryfied the user it seems to stop workin here is my code db = mysql_connect($host, $username, $password) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $BusinessName = (isset($_POST['BusinessName']) ? $_POST['BusinessName'] : ''); $Slogan = (isset($_POST['Slogan']) ? $_POST['Slogan']:''); $Business_Address = (isset($_POST['Business_Address']) ? $_POST['Business_Address']:''); $Tel = (isset($_POST['Tel']) ? $_POST['Tel']:''); $Website = (isset($_POST['Website']) ? $_POST['Website']:''); $Email = (isset($_POST['Email']) ? $_POST['Email']:''); $Member_Status = (isset($_POST['Member_Status']) ? $_POST['Member_Status']:''); $Fax =(isset($_POST['Fax']) ? $_POST['Fax']:''); $type = (isset($_POST['type']) ? $_POST['type']:''); $make = (isset($_POST['make']) ? $_POST['make']:''); $Categories = (isset($_POST['Categories']) ? $_POST['Categories']:''); $Keyword = (isset($_POST['Keyword']) ? $_POST['Keyword']:''); $Picture1 = (isset($_POST['Picture1']) ? $_POST['Picture1']:''); $Headline = (isset($_POST['Headline']) ? $_POST['Headline']:''); $Slogan2 = (isset($_POST['Slogan2']) ? $_POST['Slogan2']:''); $Description1 = (isset($_POST['Description1']) ? $_POST['Description1']:''); $Description2 = (isset($_POST['Description2']) ? $_POST['Description2']:''); $Description3= (isset($_POST['Description3']) ? $_POST['Description3']:''); $Contact2 = (isset($_POST['Contact2']) ? $_POST['Contact2']:''); $Picture2 = (isset($_POST['Picture2']) ? $_POST['Picture2']:''); $Picture3 = (isset($_POST['Picture3']) ? $_POST['Picture3']:''); $Picture4 = (isset($_POST['Picture4']) ? $_POST['Picture4']:''); $User_Name = (isset($_POST['User_Name']) ? $_POST['User_Name']:''); $Password = (isset($_POST['Password']) ? $_POST['Password']: ''); $User_Name=strtolower($_POST['User_Name']); $Password=strtolower($_POST['Password']); if ( isset($_POST['User_Name']) && isset($_POST['Password']) ) { $query = "SELECT * FROM business_info WHERE User_Name='$User_Name' AND `Password`='$Password'"; } if ($result = mysql_query($query)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); $BusinessName= $row['BusinessName']; $Keyword = $row['Keyword']; $Picture1 = $row['Picture1']; $Headline = $row['Headline']; $Slogan =$row['Slogan']; $Slogan2 = $row['Slogan2']; $Description1 =$row['Description1']; $Description2 = $row['Description2']; $Description3= $row['Description3']; $Contact2 = $row['Contact2']; $Picture2 = $row['Picture2']; $Picture3 = $row['Picture3']; $Categories=$row['Categories']; $Business_Address= $row['Business_Address']; $make=$row['make']; $type=$row['type']; $Tel= $row['Tel']; $Website=$row['Website']; } else { echo "<p><b>username and/or password not found. Try again? </b></p>"; exit; } } else { echo "Query failed<br />$query<br />". mysql_error(); exit; } ?> <? echo'$query'; echo' <table width="504" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC"> <tr> <td width="494"><table width="497" border="0"> <tr> <td width="487">Banner</td> </tr> <tr> <td background="fondo2.jpg">Welcome $BusinessName </td> </tr> <tr> Quote Link to comment https://forums.phpfreaks.com/topic/53030-selecting-data-from-the-database/ Share on other sites More sharing options...
franknu Posted May 26, 2007 Author Share Posted May 26, 2007 this is what i get when i echo the $query SELECT * FROM business_info WHERE User_Name='franklin' AND `Password`='franklin01' Quote Link to comment https://forums.phpfreaks.com/topic/53030-selecting-data-from-the-database/#findComment-261964 Share on other sites More sharing options...
franknu Posted May 26, 2007 Author Share Posted May 26, 2007 i think that maybe is the way i am echoing the data please any peace of advise here Quote Link to comment https://forums.phpfreaks.com/topic/53030-selecting-data-from-the-database/#findComment-262112 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.