Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.