MySQL Forums
Forum List  »  PHP

Tie mysql database to my website
Posted by: yassine chafik
Date: January 13, 2020 03:29PM

Hi, I'm trying to make it so that my website register accounts on my world of warcraft server but it just won't create accounts, I don't understand what I'm doing wrong, here's the code


<?
$dbhost = "50.101.185.87";
$dbuser = "root";
$dbpass = "ascent";
$dbname = "auth";

// CREATED NY MIKEAMBROSE3 DO NOT EDIT BELOW THIS!!!!
$db = mysql_pconnect($dbhost,$dbuser,$dbpass);
mysql_select_db("$dbname",$db);

$fetchh = mysql_query("SELECT * FROM accounts WHERE email='{$_POST["register"]["email"]}'")or
die(mysql_error());

$numm = mysql_num_rows($fetchh);

if (!empty($num))
die('This email already exists, Please select a new one.');

$fetch = mysql_query("SELECT * FROM accounts WHERE login='{$_POST["register"]["name"]}'")or
die(mysql_error());

$num = mysql_num_rows($fetch);

if (!empty($num))
die('This account exists, Please select a new one.');

mysql_query("INSERT INTO `accounts` (`login`, `password`, `email`) VALUES ('{$_POST["register"]["name"]}', '{$_POST["register"]["pass"]}', '{$_POST["register"]["mail"]}')");
?>

Your account has been created.<br>

Options: ReplyQuote


Subject
Written By
Posted
Tie mysql database to my website
January 13, 2020 03:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.