if (isset(($user_info['uid']) = $c_row['adminid']) && ($u_row ['accounttype'])== 1)
{
mysql_query("UPDATE `companies` SET `eviews` = `eviews` + 1 WHERE `adminid` = '${user_info['uid']}'");
}
Error: Parse error: syntax error, unexpected T_STRING, expecting ‘(’ on line 22
unemployment:
if (isset(($user_info['uid']) = $c_row['adminid']) && ($u_row ['accounttype'])== 1)
{
mysql_query("UPDATE `companies` SET `eviews` = `eviews` + 1 WHERE `adminid` = '${user_info['uid']}'");
}
Error: Parse error: syntax error, unexpected T_STRING, expecting ‘(’ on line 22
Those are great.
I’ve had loads of those, I didn’t post them here though; that would be silly.
I eventually figured out how to address them myself. Sometimes though, I politely asked for help after detailing what my desired outcome was.
AnthonySterling:
Those are great.
I’ve had loads of those, I didn’t post them here though; that would be silly.
I eventually figured out how to address them myself. Sometimes though, I politely asked for help after detailing what my desired outcome was.
Whoops… this was the error I meant to display…
Parse error: syntax error, unexpected ‘(’
r937
January 14, 2011, 8:22pm
4
there’s something wrong with your sql
I removed the isset
if ((($user_info['uid']) = $c_row['adminid']) && ($u_row ['accounttype'] = 1))
{
mysql_query("UPDATE `companies` SET `eviews` = `eviews` + 1 WHERE `adminid` = '${user_info['uid']}'");
}
Still getting this error: Parse error: syntax error, unexpected ‘=’
Immerse
January 15, 2011, 12:33am
7
You have too many parentheses in your code.
Try this:
if($user_info['uid']) == $c_row['adminid'] && $u_row ['accounttype'] == 1)
{
mysql_query("UPDATE `companies` SET `eviews` = `eviews` + 1 WHERE `adminid` = '${user_info['uid']}'");
}
Also, if you want to compare values, use ==
To make sure the values are completely identical, you can use ===
A single = is an assignment, and will always return true - so in your code above, you were trying to set $user_info[‘uid’] to have the same value as $c_row[‘adminid’]
Let us know if that’s cleared it up for you!