Hi
I am trying to setup a database to store my users in, but i dont think it is storing the details.
I also want to be able to lokup details such as the password, but everytime i try, it says "Warning: Unable to jump to row 0 on MySQL result index 2"
Could someone tell me if there are any errors in my code?
Thanks a lot
ben Periton
Add User Code:
<?
$acctype = "Free SubDomain";
$address = "$add1\n$add2\n$town\n$county\n$postcode";
require "config_inc.php";
MYSQL_CONNECT($hostname, $username, $password) or DIE("Unable to connect to MySQL server");
@mysql_select_db("$dbname") or DIE("Unable to connect to MySQL database");
$query = "INSERT INTO $tablename VALUES('$user','$password','$fname','$lname','$address','$url','$email', '$acctype')";
$exec = MYSQL_QUERY($query);
PRINT "Created new user $inputuser with password $inputpassword";
MYSQL_CLOSE();
?>
Search user code:
<?
require "config_inc.php";
MYSQL_CONNECT($hostname, $username, $password) or DIE("Unable to connect to MySQL server");
@mysql_select_db("$dbname") or DIE("Unable to connect to MySQL database");
$query = "SELECT * FROM $tablename WHERE user = '$inputuser'";
$exec = MYSQL_QUERY($query);
$newpassword = mysql_result($exec,$i,"password");
MYSQL_CLOSE();
PRINT "Your password is: $newpassword";
?>
I am trying to setup a database to store my users in, but i dont think it is storing the details.
I also want to be able to lokup details such as the password, but everytime i try, it says "Warning: Unable to jump to row 0 on MySQL result index 2"
Could someone tell me if there are any errors in my code?
Thanks a lot
ben Periton
Add User Code:
<?
$acctype = "Free SubDomain";
$address = "$add1\n$add2\n$town\n$county\n$postcode";
require "config_inc.php";
MYSQL_CONNECT($hostname, $username, $password) or DIE("Unable to connect to MySQL server");
@mysql_select_db("$dbname") or DIE("Unable to connect to MySQL database");
$query = "INSERT INTO $tablename VALUES('$user','$password','$fname','$lname','$address','$url','$email', '$acctype')";
$exec = MYSQL_QUERY($query);
PRINT "Created new user $inputuser with password $inputpassword";
MYSQL_CLOSE();
?>
Search user code:
<?
require "config_inc.php";
MYSQL_CONNECT($hostname, $username, $password) or DIE("Unable to connect to MySQL server");
@mysql_select_db("$dbname") or DIE("Unable to connect to MySQL database");
$query = "SELECT * FROM $tablename WHERE user = '$inputuser'";
$exec = MYSQL_QUERY($query);
$newpassword = mysql_result($exec,$i,"password");
MYSQL_CLOSE();
PRINT "Your password is: $newpassword";
?>