Jump to content


Help with PHP,MySQL


  • Please log in to reply
1 reply to this topic

#1 Guest_PcGamerz13_*

Guest_PcGamerz13_*
  • Guests

Posted 09 March 2006 - 10:55 PM

Deleted

#2 rjlowe

rjlowe
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationAlbuquerque

Posted 09 March 2006 - 11:13 PM

You've got too many close braces "}" I always label my close braces, otherwise I end up with errors like you have. See my //comments in your code snippett

[!--quoteo(post=353423:date=Mar 9 2006, 03:55 PM:name=PcGamerz13)--][div class=\'quotetop\']QUOTE(PcGamerz13 @ Mar 9 2006, 03:55 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
1. I get this error Parse error: parse error, unexpected '}' in Not Telling on line 142
2. I got four field in table mail: Sent_By,Sent_To,Message,Date. I need this to show From: Sent_By, Message: Message,Date: Date. Please help fix this.

<?
$sql = "SELECT * FROM `mail` WHERE Sent_To='$Username'";
$result = mysql_query($sql);
if (mysql_num_rows($result) > 0) {  // Opens the IF Clause

    while ($row = mysql_fetch_row($result)) { //Opens The While Loop

        echo '<div>';
        echo '<p>----<br /><font face="verdana" size="2" color="red">From: </font>' . $row[1];
        echo '<br /><font face="verdana" size="2" color="red">Message: </font>' . $row[2];
            echo '<br /><font face="verdana" size="2" color="red">Date: </font>' . $row[3];
            echo '<br />----</p>' . '</div>';

}  //  CLOSES the While Loop

}else{   // Continue the IF Clause
echo ("<font face='verdana' size='2'>You have no messages</font>");

} // CLOSES the IF Clause

} // Dunno what this is closing?
} // Dunno what this is closing?

mysql_free_result($result);
?>
[/quote]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users