Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.