Jump to content

need help


jtjohnson260

Recommended Posts

My friend says my database isn't set up on my site yet. This is what I get on my register page?

 

 

Fatal error: Call to a member function on a non-object in /home/content/z/h/a/zhahaman2001/html/jtjohnson260/register.php on line 46

 

 

and the line is

 

if (! $sql->query("INSERT INTO users (username, password, email, date_registered) VALUES ('$username', '$password', '$email, 'NOW'())") ) {

 

 

How do I fix this. I'm on AIM if someone can walk me through it quickly.

 

 

 

 

all the code for the page is attached

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/65603-need-help/
Share on other sites

now i have even more then before

 

Warning: mysql_query(): Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/z/h/a/zhahaman2001/html/jtjohnson260/register.php on line 47

 

Warning: mysql_query(): A link to the server could not be established in /home/content/z/h/a/zhahaman2001/html/jtjohnson260/register.php on line 47

 

Could not create user

 

 

Fatal error: Call to a member function on a non-object in /home/content/z/h/a/zhahaman2001/html/jtjohnson260/register.php on line 53

Link to comment
https://forums.phpfreaks.com/topic/65603-need-help/#findComment-327581
Share on other sites

put this inside it...

<?php
$mysql_server = "localhost";
$mysql_user = "database user here";
$mysql_password = "database user's password here";
$mysql_database = "databases name here";

mysql_connect ("localhost", "$mysql_user", "$mysql_password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("$mysql_database"); 
?>

Link to comment
https://forums.phpfreaks.com/topic/65603-need-help/#findComment-327591
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.