Results 1 to 6 of 6

Thread: Parse Error - II

  1. #1
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Parse Error - II

    can anyone shed some light on this?

    Parse error: parse error, unexpected T_IF in /xxx/x/xxx/xxx/xxx/unsub.php on line 22

    ... and line 22 says ...

    22 if($cid==0)
    23 mysql_query("update".$tableprefix."email_advt set unsubstatus=1 where id=$id AND time=$time");
    24 else


    any help would be great

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by dymo310 View Post
    Parse error: parse error, unexpected T_IF in /xxx/x/xxx/xxx/xxx/unsub.php on line 22

    ... and line 22 says ...

    22 if($cid==0)
    Look further up. Check that the preceding statement is syntactically correct and ends with a semicolon (if appropriate).

    Parsing error messages don't always refer to the error directly. They are only a starting point.

    Mike

  3. #3
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by mwinter View Post
    Parsing error messages don't always refer to the error directly.
    Don't you mean the parsing errors don't refer to the line directly. Anyways; back to the question at hand, go with what Mike posted above. Check to make sure you don't have a missing bracket or semicolon, etc. If you still need help, post the code and we could take a look at it.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  4. #4
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    this is the lines that leads to the error ...


    ?><?php
    include("config.inc.php");

    $id=$_REQUEST['id'];
    $time=$_REQUEST['t'];
    $cid=0;
    if(isset($_REQUEST['cid']))
    $cid=$_REQUEST['cid']

    if($cid==0)
    mysql_query("update".$tableprefix."email_advt set unsubstatus=1 where id=$id AND time=$time");
    else
    {
    if($mysql->total($tableprefix."email_advt","id=$id AND time=$time")>0)
    mysql_query("delete from ".$tableprefix."ea_em_n_cat where eid=$id AND cid=$cid");

  5. #5
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Code:
    $cid=$_REQUEST['cid']
    should have a semicolon at the end of it, so it should be:

    Code:
    $cid=$_REQUEST['cid'];
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  6. #6
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by thetestingsite View Post
    Code:
    $cid=$_REQUEST['cid']
    should have a semicolon at the end of it, so it should be:

    Code:
    $cid=$_REQUEST['cid'];
    Hope this helps.
    yep! that made it work perfect - HUGE thx for ur kind help


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
  •