Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse Error Problem

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, I was wondering if anyone knows what's wrong with the coding below. I receive the error "Parse error: parse error in /home/virtual/newfound/home/httpd/html/banddatabase2/updateband_audios.php on line 84
" but I can't seem to see what it is. The variable $band_id works fine. If someone could help i'd be greatful. Thanx

<?
$sql = &quot;SELECT * FROM audios_tbl WHERE band_id = '$band_id' ORDER BY name ASC &quot;;
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$nb = mysql_num_rows($req);

if ($nb<1) {
echo '<center><font face=&quot;Verdana&quot; size=&quot;2&quot;><b>No audios for this band</b></font></center>';
} else {
<a href=&quot;updateband_newaudio.php?user_id=<?php echo &quot;$user_id&quot;; ?>&band_id=<?php echo &quot;$band_id&quot;; ?>&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>New Audio</font></a>

<table border=&quot;0&quot; cellpadding=&quot;2&quot;>
<tr>
<td><font face=&quot;Verdana&quot; size=&quot;2&quot;>ID</font></td>
<td><font face=&quot;Verdana&quot; size=&quot;2&quot;>Song Name</font></td>
<td><font face=&quot;Verdana&quot; size=&quot;2&quot;>File Type</font></td>
<td></td>
</tr>

while($data = mysql_fetch_array($req)) {
echo ' <tr>
<td bgcolor=&quot;#DDDDDD&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>'.$data['id'].'</font></td>
<td bgcolor=&quot;#EEEEEE&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>'.$data['name'].'</font></td>
<td bgcolor=&quot;#DDDDDD&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>'.$data['filetype'].'</font></td>
<td bgcolor=&quot;#EEEEEE&quot;><a style=&quot;FONT-WEIGHT: bold; COLOR: red&quot; href=&quot;updateband_deleteaudio.php?id='.$data['id'].'&user_id='.$user_id.'&band_id='.$band_id.'&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>X</font></a></td>
</tr>
</table>';
}
} mysql_close($db);
?>
 
You are coding as if it was HTML mode, but it's PHP mode.
[tt]<?
$sql = &quot;SELECT * FROM audios_tbl WHERE band_id = '$band_id' ORDER BY name ASC &quot;;
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$nb = mysql_num_rows($req);

if ($nb<1) {
echo '<center><font face=&quot;Verdana&quot; size=&quot;2&quot;><b>No audios for this band</b></font></center>';
} else {
?>
<a href=&quot;updateband_newaudio.php?user_id=<?php echo &quot;$user_id&quot;; ?>&band_id=<?php echo &quot;$band_id&quot;; ?>&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>New Audio</font></a>

<table border=&quot;0&quot; cellpadding=&quot;2&quot;>
<tr>
<td><font face=&quot;Verdana&quot; size=&quot;2&quot;>ID</font></td>
<td><font face=&quot;Verdana&quot; size=&quot;2&quot;>Song Name</font></td>
<td><font face=&quot;Verdana&quot; size=&quot;2&quot;>File Type</font></td>
<td></td>
</tr>
<?php
while($data = mysql_fetch_array($req)) {
echo ' <tr>
<td bgcolor=&quot;#DDDDDD&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>'.$data['id'].'</font></td>
<td bgcolor=&quot;#EEEEEE&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>'.$data['name'].'</font></td>
<td bgcolor=&quot;#DDDDDD&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>'.$data['filetype'].'</font></td>
<td bgcolor=&quot;#EEEEEE&quot;><a style=&quot;FONT-WEIGHT: bold; COLOR: red&quot; href=&quot;updateband_deleteaudio.php?id='.$data['id'].'&user_id='.$user_id.'&band_id='.$band_id.'&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>X</font></a></td>
</tr>
</table>';
}
} mysql_close($db);
?>[/tt] //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top