Jump to content

[RESOLVIDO] Unexpected $end


Ivo Pereira
 Share

Recommended Posts

Boas pessoal,

é o seguinte, decidi dividir o meu código por funções, como tal, tenho uma página para as funções, e outra que supostamente recorrerá a ela.

functions.php:

<?php

require_once('db/ligar.php');



// functions.php

function listagem()
{

    echo "<table width='100%' border='1'>";
    echo "<tr>";
    echo "<td> </td>";
    echo "<td><strong>URL:</strong></td>";
    echo "<td><strong>Miniatura:</strong></td>";
    echo "<td><strong>Data:</strong></td>";
    echo "<td><strong>Título:</strong></td>";
    echo "<td><strong>Descrição:</strong></td>";
    echo "</tr>";
    echo "<tr>";
$sql = mysql_query("SELECT ID FROM tv_noticias ORDER BY date");
for ($pass = 0; $pass < mysql_num_rows($sql); $pass++){
  $query = mysql_query("SELECT ID FROM tv_noticias WHERE ID = ".mysql_result($sql, $pass)." LIMIT 1");	
  echo '<td><input type="radio" name="selectedid"  value="'.mysql_result($query, 0).'"/></td>';	
  $query = mysql_query("SELECT url FROM tv_noticias WHERE ID = ".mysql_result($sql, $pass)." LIMIT 1");
  echo '<td><a href="'.mysql_result($query, 0).'" target="_blank">'.mysql_result($query, 0).'</a></td>';
  $query = mysql_query("SELECT thumbnail FROM tv_noticias WHERE ID = ".mysql_result($sql, $pass)." LIMIT 1");
  echo '<td><a onclick="alert(\''.mysql_result($query, 0).'\')" href="#"><img src="'.mysql_result($query, 0).'" height="60" width="94" alt="'.mysql_result($query, 0).'"  border="0" /></a></td>';
  $query = mysql_query("SELECT date FROM tv_noticias WHERE ID = ".mysql_result($sql, $pass)." LIMIT 1");
  echo '<td>'.mysql_result($query, 0).'</td>';
  $query = mysql_query("SELECT title FROM tv_noticias WHERE ID = ".mysql_result($sql, $pass)." LIMIT 1");
  echo '<td>'.mysql_result($query, 0).'</td>';
  $query = mysql_query("SELECT description FROM tv_noticias WHERE ID = ".mysql_result($sql, $pass)." LIMIT 1");
  echo '<td>'.mysql_result($query, 0).'</td>';
  echo "</tr>";
  echo"</tr></table>";

}

?>

teste.php: (o nome da página não é esta, mas isso é irrelevante, e também tirei algo código referente ao design)

<?php

require_once('functions.php');

listagem();

?>

O erro que me dá é este:

Parse error: syntax error, unexpected $end in /v2/gestao/functions.php on line 41

Alguém me pode dar uma mãozinha? 😞

Abraço

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.