Requete SQL
Posté : 29 sept. 2005, 17:18
Salut tout l'monde !
Voilà, j'ai un petit souci, cette erreur apparait et je ne comprend pas ce qui va pas ...
"Parse error: parse error, unexpected T_STRING in /var/www/free.fr/b/f/smaky95/accueil.php on line 156"
La ligne 156 correspond à
Merci d'avance pour votre aide !
Voilà, j'ai un petit souci, cette erreur apparait et je ne comprend pas ce qui va pas ...
"Parse error: parse error, unexpected T_STRING in /var/www/free.fr/b/f/smaky95/accueil.php on line 156"
La ligne 156 correspond à
$table1 = $table_prefix.'topics';
et fait parti de ce script :<?
$nbr_sujets = 4;
$url_phpbb = "http://smaky95.free.fr/phpBB2";
$tz = 0;
$format = 'd M Y H:i';
$long_maxi = 25;
require ("config.php");
$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("my sql : erreur a la connexion");
@mysql_select_db('dbname",$db) or die("mysql: Problème de selection de base");
$table1 = $table_prefix.'topics';
$table2 = $table_prefix.'forums';
$table3 = $table_prefix.'posts';
$sql = "SELECT t1.topic_last_id, t1.forum_id, t1.topic_title, t1.topic_id, t1.topic_time, t2.forum_id, t2.auth_view, t2.auth_read, t3.post_id, t3.post_time FROM $table1 t1, $table2 t2, $table3 t3 WHERE t2.auth_view = '0' AND t2.auth_read = '0' AND t1.forum_id = t2.forum_id AND t3.post_id=t1.topic_last_post_id ORDER BY t1.topic_last_post_id DESC LIMIT $nbr_sujets";
if($r = mysql_query($sql, $db)) {
while($m = musql_fretch_array($r)) {
$m[topic_title] = stripslashes($m[topic_title]);
$m[topic_title] = substr($m[topic_title], 0, $long_maxi);
$post_date = @gmdate($format, $m[post_time] + (3600 * $tz));
$print = " <table width=\"200\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td> [$post_date]</td>
</tr>
<tr>
<td>- $m[topic_title]
</td>
</tr>
<tr>
<td aling=\"right\"><a href=\"$url_phpBB/viewtopic.php?t=$m[topic_id]\" target=\"_blank\">Lire la suite... </a>
</td>
</tr>
</table>";
echo $print;
}
}
?>
Quelq'un pourrait-il me dire ce qui n'est pas bon ? Ce script fonctionnait parfaitement avant que je ne change de serveur, je pense pourtant avoir tout bien adapté ... Merci d'avance pour votre aide !