Log in

View Full Version : Parse Error - II



dymo310
05-07-2007, 09:01 PM
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

mwinter
05-07-2007, 09:05 PM
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

thetestingsite
05-07-2007, 09:13 PM
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.

dymo310
05-07-2007, 09:14 PM
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");

thetestingsite
05-07-2007, 09:15 PM
$cid=$_REQUEST['cid']


should have a semicolon at the end of it, so it should be:



$cid=$_REQUEST['cid'];


Hope this helps.

dymo310
05-07-2007, 09:47 PM
$cid=$_REQUEST['cid']


should have a semicolon at the end of it, so it should be:



$cid=$_REQUEST['cid'];


Hope this helps.

yep! that made it work perfect - HUGE thx for ur kind help

:)