...

View Full Version : Not seeing the end of the problem



blackrain87
12-25-2010, 01:00 AM
Hello there,

I can't seem to find the problem in my small script. Here is the 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.

oesxyl
12-25-2010, 01:44 AM
Hello there,

I can't seem to find the problem in my small script. Here is the 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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum