Page 1 of 1

code is not working

Posted: Tue Apr 05, 2011 4:36 am
by bluestar
i want to make a program to retrieve the password for a given email....
i had made a table named 'table1'with column name userid, EMAIL and password but the code is not working can anybody tell me what am i doing wrong??


Code: Select all

<?php
$localhost="host";
$username="admin";
$password="1234567891011";
$db="table1";
$email:xyz@yahoo.com;
$link=mysql_connect($localhost,$username,$password) or die("some prob1");
$database=mysql_select_db($db,$link)or die("some prob2");
$query = "select PASSWORD from member_login where EMAIL='$email'";
$result=mysql_query($query,$link) or die('some problem with your email');
     
   $row = mysql_fetch_array($result);

	echo $row['PASSWORD'];
?>

Re: code is not working

Posted: Tue Apr 05, 2011 8:51 am
by Weirdan
Simple code problem => moved to PHP Code

Re: code is not working

Posted: Tue Apr 05, 2011 10:24 am
by fugix
what is the error(s) that you are getting from this?

Re: code is not working

Posted: Wed Apr 06, 2011 8:14 am
by Apocalypz
Line 6 should be:

Code: Select all

$email="xyz@yahoo.com";