SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: If/Else Exit

  1. #1
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation If/Else Exit

    EDIT: OK this gets me Parse error: syntax error, unexpected T_BOOLEAN_AND in /home/infiniti/public_html/search.php on line 167

    Code:
    if (!((($s+$limit)/$limit)==$pages) && $pages!=1) && ($numrows > 0) {
    $news=$s+$limit;
    echo "&nbsp;<a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 &gt;&gt;</a>";}
    Any idea why and how to fix it?

    Thanks

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First problem is the brackets are mismatched.

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this rite?

    Code:
    if (!((($s+$limit)/$limit)==$pages) && $pages!=1 && $numrows > 0) {
    $news=$s+$limit;
    echo "&nbsp;<a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 &gt;&gt;</a>";}

  4. #4
    SitePoint Evangelist ferrari_chris's Avatar
    Join Date
    Mar 2008
    Location
    NP, New Zealand
    Posts
    576
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by GameInfiniti View Post
    this rite?

    Code:
    if (!((($s+$limit)/$limit)==$pages) && $pages!=1 && $numrows > 0) {
    $news=$s+$limit;
    echo "&nbsp;<a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 &gt;&gt;</a>";}
    Brackets all seem OK to me.

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for helping me realize the problem


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •