victormil Posted July 9, 2011 Share Posted July 9, 2011 Estou tentando inserir no meu site as noticias do WHMCS através do codigo: <?php include("/dbconnect.php"); include("/includes/functions.php"); $query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC LIMIT 0,3"; $result = mysql_query($query); while ($data = mysql_fetch_array($result)) { $id = $data["id"]; $date = $data["date"]; $title = $data["title"]; $announcement = $data["announcement"]; $date = fromMySQLDate($date); echo("<p><font color=#cccccc>$date</font> - <b>$title</b><br>$announcement</p>"); } ?>[/HTML] Ao inseri-lo no site, não aparece as noticias e sim aparece um quadrado com : [PHP]$date - $title $announcement "); } ?> [/PHP] Alguem teria como me ajudar? Link to comment Share on other sites More sharing options...
Jordan Miguel Posted July 9, 2011 Share Posted July 9, 2011 Já tentou escapar as variáveis? [COLOR=#000080]<?php include("/dbconnect.php"); include("/includes/functions.php"); $query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC LIMIT 0,3"; $result = mysql_query($query); while ($data = mysql_fetch_array($result)) { $id = $data["id"]; $date = $data["date"]; $title = $data["title"]; $announcement = $data["announcement"]; $date = fromMySQLDate($date); echo"<p><font color=#cccccc>".$date."</font> - <b>".$title."</b><br>".$announcement."</p>"; } ?>[/COLOR] Link to comment Share on other sites More sharing options...
mrladeia Posted July 9, 2011 Share Posted July 9, 2011 isso mesmo voce tem que concatenar as variaveis com a string. Ex: $var1 = "P"; $var2 = "D"; $var3 = "H"; $tudo = "Este é o forum do " . $var1 . $var2 . $var3; echo $tudo;[/PHP] Resultado: Este é o forum do PDH Link to comment Share on other sites More sharing options...
victormil Posted July 9, 2011 Author Share Posted July 9, 2011 O problema é que eu não sei mecher com web programação. Tentei por o codigo que o Jordan Miguel citou e deu o mesmo erro.. Link to comment Share on other sites More sharing options...
Recommended Posts