Adblock breaks this site

Need help with some PHP/MYSQL code

Discussion in 'Web Programming' started by fighter1431, May 8, 2009.

  1. fighter1431

    fighter1431 Forum Addict

    Joined:
    Feb 21, 2007
    Posts:
    418
    Referrals:
    0
    Sythe Gold:
    0
    Need help with some PHP/MYSQL code

    Hi everyone.

    I have some code that checks a password to login to a website but somehow I get an error and I don't know what causes it.

    This is the code.
    Code:
    $object=mysql_fetch_object($query)
    $passwordcheck=$object->password;
    if (isset($passwordcheck))
    {$check="This Email-Adres does not exist in the ERS Database;}
    
    I get this error.


    Parse error: parse error, expecting `'}'' in C:\wamp\www\testers 2.10\logintest.php on line 25

    I checked and there is no error in another part then this.

    Any suggestions would be usefull =)
     
  2. Nullware

    Nullware Guru

    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0
    Need help with some PHP/MYSQL code

    There's no ending quote ( " ) at the end of your string. Usually parse errors are caused by incorrect amounts of quotation marks, brackets, braces, and other enclosing symbols.

    Code:
    $object=mysql_fetch_object($query)
    $passwordcheck=$object->password;
    if (isset($passwordcheck))
    {$check="This Email-Adres does not exist in the ERS Database";}
    
     
  3. fighter1431

    fighter1431 Forum Addict

    Joined:
    Feb 21, 2007
    Posts:
    418
    Referrals:
    0
    Sythe Gold:
    0
    Need help with some PHP/MYSQL code

    Thanks for the help I changed it but i still get the same error.
     
  4. i am java

    i am java Active Member

    Joined:
    Apr 9, 2008
    Posts:
    231
    Referrals:
    0
    Sythe Gold:
    0
    Need help with some PHP/MYSQL code

    Well, this is what I think:

    PHP:
    $object=mysql_fetch_object($query);
    $passwordcheck=$object->password;
    if (isset(
    $passwordcheck))
    {
    $check="This Email-Adres does not exist in the ERS Database";}
     
  5. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    Need help with some PHP/MYSQL code

    See above.

    Also, not an actual error, but why are you using isset()? In your if() statement, isset() will always return true because you just gave it a value the line before...

    http://us3.php.net/isset
     
  6. fighter1431

    fighter1431 Forum Addict

    Joined:
    Feb 21, 2007
    Posts:
    418
    Referrals:
    0
    Sythe Gold:
    0
    Need help with some PHP/MYSQL code

    It won't return true if there is no return from the database.
     
< Radio banner rotation script needed. | Looking for a free .com web host and design ideas for a forum. >


 
 
Adblock breaks this site