~alex~
2007-05-10 13:37:40
Well I've been learning Php so I can build myself an auth server. I've been doing pretty well. I've made a page that can add users to the data base and stuff but Im having problems getting the script to actually see if a user exists in the database..
Anytime I try to run this script im getting
"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /www/1111mb.com/s/c/a/scaralex/htdocs/login2.php on line 10 "
[PHP]<?php
$con = mysql_connect("localhost","hmmmm..","Cant tell you that hehe");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("users", $con);
while($row = mysql_fetch_array(mysql_query("SELECT * FROM udata WHERE Username= .$_POST[user]")));
{
if ($row['username'] = $_POST["user"]){
if ($row['password'] = $_POST["pass"]){
die("accepted");
}
}
}
die("Declined");
?>[/PHP]
It wouldn't suprise me if the enitre thing was wrong but I'd still like a lil help :P
Anytime I try to run this script im getting
"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /www/1111mb.com/s/c/a/scaralex/htdocs/login2.php on line 10 "
[PHP]<?php
$con = mysql_connect("localhost","hmmmm..","Cant tell you that hehe");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("users", $con);
while($row = mysql_fetch_array(mysql_query("SELECT * FROM udata WHERE Username= .$_POST[user]")));
{
if ($row['username'] = $_POST["user"]){
if ($row['password'] = $_POST["pass"]){
die("accepted");
}
}
}
die("Declined");
?>[/PHP]
It wouldn't suprise me if the enitre thing was wrong but I'd still like a lil help :P