Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-25-2010, 12:00 AM   PM User | #1
blackrain87
New Coder

 
Join Date: Jun 2010
Posts: 71
Thanks: 14
Thanked 0 Times in 0 Posts
blackrain87 is an unknown quantity at this point
Not seeing the end of the problem

Hello there,

I can't seem to find the problem in my small script. Here is the code:
PHP Code:
<?php
session_start
();
require_once 
'database.php';
$userid $_SESSION['user'];
$stats=mysql_query("SELECT * FROM user WHERE username='$userid'") or die("Error 1");
$data=mysql_fetch_assoc($stats);
$pm=mysql_query("SELECT * FROM mail WHERE receiverid='$data[id]' and send='0'") or die("Error 2");
echo 
'<table border="1" width="600px">';
echo 
'<tr><td>Status</td><td>From</td><td>Subject</td><td>Sent</td></tr>';
while(
$rows=mysql_fetch_array($pm)){
echo 
'<tr><td>';
if(
$rows[hasread] == 1){ 
echo 
'<img src="../images/new.gif" alt="New" width="45" height="45">';
}
else{ 
echo
'<img src="../images/old.gif" alt="Read" width="45" height="45">
}'
;
echo 
'</td><td>'.$rows[senderid].'</td><td><a href="?page=read&id='.$rows[id].'">'.$rows[subject].'</a></td><td>'.$rows[showtime].'</td></tr>';
// line 19
The error is: unexpected $end on line 19
Line 19 is marked for you. I do not see where this error is coming from. Any assistance is grateful.
blackrain87 is offline   Reply With Quote
Old 12-25-2010, 12:44 AM   PM User | #2
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by blackrain87 View Post
Hello there,

I can't seem to find the problem in my small script. Here is the code:
PHP Code:
<?php
session_start
();
require_once 
'database.php';
$userid $_SESSION['user'];
$stats=mysql_query("SELECT * FROM user WHERE username='$userid'") or die("Error 1");
$data=mysql_fetch_assoc($stats);
$pm=mysql_query("SELECT * FROM mail WHERE receiverid='$data[id]' and send='0'") or die("Error 2");
echo 
'<table border="1" width="600px">';
echo 
'<tr><td>Status</td><td>From</td><td>Subject</td><td>Sent</td></tr>';
while(
$rows=mysql_fetch_array($pm)){
echo 
'<tr><td>';
if(
$rows[hasread] == 1){ 
echo 
'<img src="../images/new.gif" alt="New" width="45" height="45">';
}
else{ 
echo
'<img src="../images/old.gif" alt="Read" width="45" height="45">
}'
// <-- HERE
echo '</td><td>'.$rows[senderid].'</td><td><a href="?page=read&id='.$rows[id].'">'.$rows[subject].'</a></td><td>'.$rows[showtime].'</td></tr>';
// line 19
The error is: unexpected $end on line 19
Line 19 is marked for you. I do not see where this error is coming from. Any assistance is grateful.
you have a single quote between } and ; on line 17.

best regards
oesxyl is offline   Reply With Quote
Users who have thanked oesxyl for this post:
blackrain87 (12-25-2010)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:42 AM.


Advertisement
Log in to turn off these ads.