madspof Posted October 7, 2007 Share Posted October 7, 2007 I have this script but it keeps giving me this error Parse error: parse error, unexpected '[' in C:\Deskfun\Halo 3 clan\updateusers.php on line 65, i think its is becuase i have an if function in a while funcation that is in a if funcation again any way any help would be apprecaited thanks here is hte code: <?php // Check if there is a cookie, if there isn't then exit! if (!isset($_COOKIE['cookie_info'])) { echo "You are not logged in."; exit; } elseif (!isset($_COOKIE['cookie_info1'])) { echo "You are not an admin."; exit; } else{ include 'connect.php'; $activate = ""; $query = "SELECT Gamertag, Authorised FROM members"; $result = mysql_query($query); $count = 1; while($row = mysql_fetch_assoc($result)) { if(row[Authorised] == 1){ $activate = "Deactivate"; } else{ $activate = "Activate"; } echo "Name :{$row['Gamertag']} <br>" . "activated : $activate <br>"; $count++; } } ?> Link to comment https://forums.phpfreaks.com/topic/72184-why-do-i-get-an-error-help/ Share on other sites More sharing options...
sstangle73 Posted October 7, 2007 Share Posted October 7, 2007 witch line is 65? Link to comment https://forums.phpfreaks.com/topic/72184-why-do-i-get-an-error-help/#findComment-364001 Share on other sites More sharing options...
sstangle73 Posted October 7, 2007 Share Posted October 7, 2007 im thinking this is 65 instead of echo "Name :{$row['Gamertag']} <br>" . "activated : $activate <br>"; try echo "Name :" . $row[Gamertag] . " <br> activated : " . $activate . " <br>"; Link to comment https://forums.phpfreaks.com/topic/72184-why-do-i-get-an-error-help/#findComment-364002 Share on other sites More sharing options...
d.shankar Posted October 7, 2007 Share Posted October 7, 2007 I hope this works <?php // Check if there is a cookie, if there isn't then exit! if (!isset($_COOKIE['cookie_info'])) { echo "You are not logged in."; exit; } elseif (!isset($_COOKIE['cookie_info1'])) { echo "You are not an admin."; exit; } else{ include 'connect.php'; $activate = ""; $query = "SELECT Gamertag, Authorised FROM members"; $result = mysql_query($query); $count = 1; while($row = mysql_fetch_assoc($result)) { if($row['Authorised'] == 1){ $activate = "Deactivate"; } else{ $activate = "Activate"; } echo "Name :{$row['Gamertag']} <br>" . "activated : $activate <br>"; $count++; } } ?> Link to comment https://forums.phpfreaks.com/topic/72184-why-do-i-get-an-error-help/#findComment-364004 Share on other sites More sharing options...
sstangle73 Posted October 7, 2007 Share Posted October 7, 2007 oh yeah that looks like that will be the one. Link to comment https://forums.phpfreaks.com/topic/72184-why-do-i-get-an-error-help/#findComment-364006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.