Radwan Aladdin wrote:
Hi all.. I made this code for the login.php page.. it will compare A value from the users machine (Serial) and with a value inside the database (In that users' row).. so after logging it will check if also this value is the same and then echo something..is the following code is right for that? :
<?php
$link = mysql_connect("localhost", "Database username", "Database password) or die("Could
not connect: " . mysql_error());
mysql_select_db("Table name", $link);
$UserName = $_GET['UserName'];
$Password = $_GET['Password'];
$Serial = $_GET['Serial'];
$query = "SELECT Serial, Password from accounts where UserName='$UserName'";
$result = mysql_query($query) or die("Query errort: " . mysql_error());
$row = mysql_fetch_row($result) or die("User Not found: " . mysql_error());
$Serial = htmlspecialchars($row[0]);
mysql_select_db is for selecting the database and NOT the table, the
SELECT statement must be something like this: "select SOMETHING from
TABLE where WHERE_CLAUSE"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php