dudhi
07-03-2007, 11:42 AM
This is my code right now.
mysql_select_db($dbname);
echo "<br>";
$name = $_POST["name"];
$password = $_POST["pass"];
$query = " select * from `XXX`";
print_r($query);
echo "<br>";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
if( $row["UserName"] == $name)
{
echo $row["Password"];
echo "<br>";
}
What I have been trying to do is run this mysql comman
" Select `password` from xxx where username = $_POST["name"] "
But when I try to use while ($row = mysql_fetch_assoc($result)) command
with it, never works for me so had to modify mysql command and use the if loop after that. Was wondering if there is any other fetch command I can use.
Thanks to anyone looking into this.
mysql_select_db($dbname);
echo "<br>";
$name = $_POST["name"];
$password = $_POST["pass"];
$query = " select * from `XXX`";
print_r($query);
echo "<br>";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
if( $row["UserName"] == $name)
{
echo $row["Password"];
echo "<br>";
}
What I have been trying to do is run this mysql comman
" Select `password` from xxx where username = $_POST["name"] "
But when I try to use while ($row = mysql_fetch_assoc($result)) command
with it, never works for me so had to modify mysql command and use the if loop after that. Was wondering if there is any other fetch command I can use.
Thanks to anyone looking into this.