What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Sign up & SQL table problem

Sign up & SQL table problem
Author: Message:
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Sign up & SQL table problem
I see 3 database names...

In your post you say it's easyflas_testdb, in the php files it's easyflas_spoonodb and spoono_db. Are you sure that's correct!

Besides that, you are making a lot of thinking mistakes. The first:

code:
<?
error_reporting(E_ALL);

//replace username and password with your mysql name and password
$conn = mysql_connect("localhost","easyflas_zaher19","okk");

//select the database
$db = mysql_select_db("easyflas_spoonodb");

$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];

//insert the values
$result=mysql_query("INSERT INTO users(`id`,`username`,`password`,`email`) VALUES ('', '" . $username . "', '" . $password . "', '" . $email . "')");
   
if($result) {
   echo "Your name and password have been submitted into our database :)";
}
else {
   echo "Error while inserting: " . mysql_error();
}
?>

The second:
code:
<?
error_reporting(E_ALL);

$conn = mysql_connect("localhost","eastflas_zaher19","okk");
$db = mysql_select_db("spoono_db");

$username = $_POST["username"];
$password = $_POST["password"];

$result = mysql_query("SELECT * from users WHERE username='" . $username . "' ABD password='" . $password . "'")
   or die ("Error in your query: " . mysql_error());

if(mysql_num_rows($result) > 0) {
   $worked = mysql_fetch_array($result);
   
   $username = $worked['username'];
   $password = $worked['password'];
   $email = $worked['email'];
   
   echo "Welcome $user! Your e-mail address is $email";
}
else {
   echo "No username / password match found!";
}
?>


And off course first look at the database names. This should work...
09-17-2005 09:22 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Sign up & SQL table problem - by zaher1988 on 09-16-2005 at 12:42 PM
RE: Sign up & SQL table problem - by WDZ on 09-16-2005 at 02:32 PM
RE: Sign up & SQL table problem - by zaher1988 on 09-16-2005 at 02:56 PM
RE: Sign up & SQL table problem - by J-Thread on 09-16-2005 at 06:27 PM
RE: Sign up & SQL table problem - by zaher1988 on 09-16-2005 at 07:10 PM
RE: Sign up & SQL table problem - by J-Thread on 09-16-2005 at 07:16 PM
RE: Sign up & SQL table problem - by J-Thread on 09-16-2005 at 07:17 PM
RE: Sign up & SQL table problem - by zaher1988 on 09-16-2005 at 07:25 PM
RE: Sign up & SQL table problem - by J-Thread on 09-17-2005 at 09:22 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On