This question is an exact duplicate of:
I know it must be something simple but I can't do
I need display the text into a <div>
Like this:
<div>
<p><font color="#bdbdbd">TEXTO FROM MYSQL</font></p>
</div>
My table structure is:
id int(11) Nulo: Não Padrão:Nenhum AUTO_INCREMENT
depoimento varchar(255) utf8_unicode_c… NULL
client varchar(60) utf8_unicode_ci Nulo:Sim Pa… NULL
I'm trying this:
$db['server'] = 'localhost';
$db['user'] = '**';
$db['password'] = '***';
$db['dbname'] = '**********';
$conn = mysql_connect($db['server'],$db['user'],…
mysql_select_db($db['dbname'],$conn);
$sql = "SELECT * FROM opinions ORDER BY id DESC LIMIT 15";
$resultado = mysql_query($sql)
while ($linha=mysql_fetch_array($resultado)) {
$depoimento = $linha["depoimento"];
$client = $linha["client"];
echo "$depoimento";
echo "$client";
}
?>
But it still appearing blank I'm using a SEMI DEDICATED SERVER (VPS)
Any idea?
Thanks!
</div>
$resultado = mysql_query($sql, $conn);
Try telling the query which connection resource to use, also some well placed var_dumps will help debug the code.
while ($linha=mysql_fetch_array($resultado)) {
var_dump($linha); exit;
$depoimento = $linha["depoimento"];
$client = $linha["client"];
echo "$depoimento";
echo "$client";
}