Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

When include database connection i'm lost my script

us-22us-22 Posts: 2Member
hi all,

i'm begginers in php

i have register form , and when i include database file i'm lost my program.

and printout blank screen.

i think the program excute database file then connect to database and stop program after that.

my code:
[hr]
if($error){
echo "Error:
$message
please try again";
}
else
{
if($username && $pass && $name && $lastname && $email){
[color=Red]include('mydatabase.php');[/color]
// make sure the username is not already taken
$query = "SELECT user_id FROM users WHERE username = "$username"";
$result = @mysql_query($query);
if(mysql_num_rows($result) == 0){
$query = "INSERT INTO users(username, password, firstname, lastname, email, registeration_date)
VALUES('$username','$pass','$name','$lastname','$email',NOW())";
$result = mysql_query($query);
if($result){
echo "Tahnks, your registration has been seccefule";
mysql_close();
}
}
else
{
echo "Sorry, username has already taken, please try again with deffrint username";
}
}
else{
echo "hi";
}
}
-----------------------------------------------------------------

so any one can help me

Comments

  • pritaeaspritaeas Posts: 274Member
    : hi all,
    :
    : i'm begginers in php
    :
    : i have register form , and when i include database file i'm lost my
    : program.
    :
    : and printout blank screen.
    :
    : i think the program excute database file then connect to database
    : and stop program after that.
    :
    : my code:
    :
    : so any one can help me
    :

    Well, if the problem occurs when you include the database.php, then the problem must be in that file. If you want someone to look at it, upload it here. If not, place echo's at critical locations, to see where the code stops and fix it.
  • us-22us-22 Posts: 2Member
    : : hi all,
    : :
    : : i'm begginers in php
    : :
    : : i have register form , and when i include database file i'm lost my
    : : program.
    : :
    : : and printout blank screen.
    : :
    : : i think the program excute database file then connect to database
    : : and stop program after that.
    : :
    : : my code:
    : :
    : : so any one can help me
    : :
    :
    : Well, if the problem occurs when you include the database.php, then
    : the problem must be in that file. If you want someone to look at it,
    : upload it here. If not, place echo's at critical locations, to see
    : where the code stops and fix it.



    hi,

    yes i think that too.

    ok i well upload my file , it's simple connect file, look at attachment file. you can find three file: register.php, db.php, registerform.php.

    thanks for your help
  • pritaeaspritaeas Posts: 274Member
    : : : hi all,
    : : :
    : : : i'm begginers in php
    : : :
    : : : i have register form , and when i include database file i'm lost my
    : : : program.
    : : :
    : : : and printout blank screen.
    : : :
    : : : i think the program excute database file then connect to database
    : : : and stop program after that.
    : : :
    : : : my code:
    : : :
    : : : so any one can help me
    : : :
    : :
    : : Well, if the problem occurs when you include the database.php, then
    : : the problem must be in that file. If you want someone to look at it,
    : : upload it here. If not, place echo's at critical locations, to see
    : : where the code stops and fix it.
    :
    :
    :
    : hi,
    :
    : yes i think that too.
    :
    : ok i well upload my file , it's simple connect file, look at
    : attachment file. you can find three file: register.php, db.php,
    : registerform.php.
    :
    : thanks for your help
    :

    In register.php I found this code:

    require('rrtdb.php');

    In your zip, the file is named 'db.php'. This could be the error, since it should not find that file. If this is not the case, remove the @ before your function calls to see if it shows an error.
Sign In or Register to comment.