[UPDATED] with new code "sql_real_escape_string ()"
[UPDATED] if someone wants to see the site on a test site
[UPDATED] with while code showing any results via echo
Hello to all,
I looked through a lot of posts on this, but just can't figure out why the following code is not working:
$username = $_POST['username']; // get the record of the user, by looking up username in the database. $query = sprintf("SELECT UserName, Password FROM userlogin WHERE UserName='%s'", mysql_real_escape_string($username)); $result = mysqli_query($dbc, $query) or die ("Error Querying Database for: " . $query . "<br />Error Details: " . mysql_error() . "<br/>" . $result); while ($row = mysqli_fetch_assoc($result)) { Echo($row['UserName']); }
The code seems correct ... the database works fine (for input purposes), and the connection is the joint connection used with require_once ('databaseconnection.php'); which works on the registration side of things.
as usual, I am sure that this is something simple that I forgot, but I canโt let life see me!
I do not get any error messages from myssql_error () just a space.
any help would be greatly appreciated.
Hello
source share