Jump to content

URGENT HELP!!


jdproject

Recommended Posts

I am creating a member site and I need help with coding the database. Here go the code

 

<?php
function connect(){
$DB_USER =  "root";
$DB_PASSWORD = "";
$DB_HOST = "localhost";
$dbc = mysql_connect ($DB_HOST, $DB_USER, $DB_PASSWORD) or $error = mysql_error();
mysql_select_db("membership") or $error = mysql_error();
mysql_query("SET NAMES `utf8`") or $error = mysql_error();

if($error){echo "<!-- $error -->";}}

function disconnect_data(){
@mysql_close($dbc);
@mysql_close();
}
?>

I am suppose to fill it in with my database info but idk what to fill in! help me please! where do i enter the info!

Link to comment
Share on other sites

The info is stored within the $DB_USER, $DB_PASSWORD and $DB_HOSTNAME variables.

 

Be aware that your disconnect_data() function references a variable $dbc, this variable does not exist within the function and will cause an error.

Link to comment
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.