Jump to content

[SOLVED] Parse error: syntax error, unexpected T_VARIABLE


almightyegg

Recommended Posts

I'm getting this error:

Parse error: syntax error, unexpected T_VARIABLE in /home/lordofth/public_html/player/viewfind.php on line 75

 

$ac2 = mysql_query("SELECT * FROM users WHERE username LIKE '%$account%'") or die(mysql_error());
$ac2 = mysql_num_rows($ac2) or die(mysql_error());
// unrelated code.
$accounts = mysql_fetch_array($ac2)
$ID = $accounts['id']; // LINE 75
header("Location: view.php?id=$ID");

oops oh yeah :P

 

NowI have another error  :-[

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/lordofth/public_html/player/viewfind.php on line 48

 

<?
while($accounts = mysql_fetch_array($ac2)){ //line 48
?>

mysql_fetch_array requires the result resource from mysql_query not mysql_num_rows

$ac2 = mysql_query("SELECT * FROM users WHERE username LIKE '%$account%'") or die(mysql_error());
$accounts = mysql_fetch_array($ac2);
$ID = $accounts['id'];

header("Location: view.php?id=$ID");

Oops, yep that is sorted now :) just one last thing.

 

Warning: Cannot modify header information - headers already sent by (output started at /home/lordofth/public_html/player/db.php:10) in /home/lordofth/public_html/player/viewfind.php on line 76

The header is made after the <html> is closed... and it is not in the same if/else statement as any <html> tags anyway... why does it show the error?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.