DeluXe Network Forums
March 18, 2010, 10:03:45 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Please do not add ads in your signature!
 
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: there is no out put with this code  (Read 838 times)
samit
Newbie
*

Honor: 0
Offline Offline

Sri Lanka Sri Lanka

Posts: 4


View Profile
« on: September 21, 2008, 05:48:11 pm »

there is no out put with this code,there is no errors as well, can some one help me, here is the code



<html>
<body>
<form method='post' action='output.php'>
<input type='text' name='f_name' size='12'>
<input type='submit' value='show'>
</form>
</body>
</html>
<?php
$a=$_POST['f_name'];
$user="root";
$host="localhost";
$password="";
$database="diki";
$connection=mysql_connect($host,$user,$password);
$db=mysql_select_db($database,$connection) or die( "Unable to select database");
$query = "select contact from member where f_name='$a'";
$result=mysql_query($query) or die ("couldnot excute query");
if ($a=f_name)
while ($row=mysql_fetch_array($result));
{
echo "$row[f_name]";
echo "$row[address]";

}
mysql_close();
php?>

__________________________
Permanent Links
Logged
Michael
Administrator
Hero Member
*****

Honor: 11
Offline Offline

Germany Germany

Posts: 3253



View Profile WWW
« Reply #1 on: September 22, 2008, 02:08:28 am »

what is your username? you will need to change the user from root to it, and dont usw "localhost" as mysql host, use "mysql"
Logged
Endrju
Global Moderator
Hero Member
*****

Honor: 4
Offline Offline

Poland Poland

Posts: 2466



View Profile WWW
« Reply #2 on: September 24, 2008, 02:14:41 pm »

And of course enter correct password and username as database name.
Logged

Straight Edge till death.
Pages: [1]
  Print  
 
Jump to:  

 

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.118 seconds with 16 queries.