Need help with some PHP/MYSQL code

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

Need help with some PHP/MYSQL code
  1. Unread #1 - May 8, 2009 at 5:34 AM
  2. fighter1431
    Joined:
    Feb 21, 2007
    Posts:
    418
    Referrals:
    0
    Sythe Gold:
    0

    fighter1431 Forum Addict

    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 =)
     
  3. Unread #2 - May 8, 2009 at 7:34 PM
  4. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    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";}
    
     
  5. Unread #3 - May 9, 2009 at 10:13 AM
  6. fighter1431
    Joined:
    Feb 21, 2007
    Posts:
    418
    Referrals:
    0
    Sythe Gold:
    0

    fighter1431 Forum Addict

    Need help with some PHP/MYSQL code

    Thanks for the help I changed it but i still get the same error.
     
  7. Unread #4 - May 9, 2009 at 10:32 AM
  8. i am java
    Joined:
    Apr 9, 2008
    Posts:
    231
    Referrals:
    0
    Sythe Gold:
    0

    i am java Active Member

    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";}
     
  9. Unread #5 - May 10, 2009 at 1:27 AM
  10. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    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
     
  11. Unread #6 - May 10, 2009 at 5:42 AM
  12. fighter1431
    Joined:
    Feb 21, 2007
    Posts:
    418
    Referrals:
    0
    Sythe Gold:
    0

    fighter1431 Forum Addict

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

Users viewing this thread
1 guest


 
 
Adblock breaks this site