Jump to content
xisto Community
Sign in to follow this  
beeseven

Graarhahrgh Mysql And Php Won't Work

Recommended Posts

I have this code that I've tried everything to fix it, but it still won't work. I'm hoping someone here will be able to help.

First, the open database file:

<?phpfunction opendatabase(){	$hostname = "localhost";	$username = "beeseven";	$password = "**REMOVED**";	$database = "beeseven_**REMOVED**";	mysql_connect($hostname,$username,$password) or die("Could not connect to database");	mysql_select_db($database) or die("Could not select to database");}?>
I have that included in the register file:
//variables and whatnot	include 'opendatabase.php';	opendatabase();$mysql_query = mysql_query("INSERT INTO users (name, password, concode, confirmed, email, joined, job, level, exp, moves, weapon) VALUES ($name, $password, $concode, $confirmed, $email, $joined, $job, $level, $exp, $moves, $weapon)"); //here's where my problem is	if($mysql_query === false) //this checks if the username is taken	{  $err = mysql_errno();  if($err == 1062) //1062 is the duplicate entry for unique field error  {  	echo "<div class=\"err\">Error: Username taken.</div>";  	die("</body></html>");  }	}	mysql_close();
My problem is with the query. I can't think of any reason why it wouldn't work- everything is stripslashes()'d, and I even have it echo the variables at the end and there's nothing that should cause any problems.

Share this post


Link to post
Share on other sites

If you're using Xisto host, I think you use the wrong username, cause all Xisto username is prefix with your cpanel username... and your prefix is beeseven, and so if your username you entered is beeseven, then your $username = "beeseven_beeseven";

Share this post


Link to post
Share on other sites

If you're using Xisto host, I think you use the wrong username, cause all Xisto username is prefix with your cpanel username... and your prefix is beeseven, and so if your username you entered is beeseven, then your $username = "beeseven_beeseven";

153733[/snapback]

I though about that, but for my forum I just used "beeseven" and that worked fine.

 

its def on your side... you need to get some error info here... wat exactly is your report saying?

153756[/snapback]

There is no report, it just won't submit it. I got it to echo all the variables, then I copied the query into PHPmyAdmin and it worked fine.

Share this post


Link to post
Share on other sites

ok, go to mysql database through your cpanel, then copy and paste your sql database name and your sql username... I'll check it out as the thing is funny...

Share this post


Link to post
Share on other sites

Okay, now that finals are over (my school gets out so late >_<), I've been trying to fix this. I made a database account and gave it all privileges, then I changed opendatabase, but now I get this error:

 

Warning: mysql_connect(): Access denied for user: 'beeseven_ammin@localhost' (Using password: YES) in /home/beeseven/public_html/gaem/opendatabase.php on line 8

Could not connect to database

Share this post


Link to post
Share on other sites

ok, use that rial sql account and give us the username and password and other required information, we'll try to help you sort it out...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.