Chi mi puo' aiutare ??
Mi capita una cosa strana:
Con questo script tiro fuori determinate informazioni per il listato annunci e le è à ù ecc si vedono perfettamente.
Codice PHP:
<?php
//includiamo il file della classe
@require("paginazione.php");
//connettiamoci a MySQL e selezioniamo il database
class MySQL
{
function MySQL()
{
require "db_connect.php";
}
}
$data = new MySQL();
// istanziamo la classe per l'impaginazione
$p = new Paging;
// numero massimo di risultati per pagina
$max = 10;
// identifichiamo la pagina da cui iniziare la numerazione
$inizio = $p->paginaIniziale($max);
// contiamo i records nel database
// contiamo i records nel database
$query_count = @mysql_query(
"SELECT * FROM
annunci INNER JOIN cliente ON (annunci.clienteid=cliente.id )
INNER JOIN modello ON (annunci.modelloid=modello.id)
INNER JOIN users ON (annunci.user_id=users.id)
WHERE
modello.modello='azioni' ORDER BY `id_annunci` DESC ")
or die (mysql_error());
$count = @mysql_num_rows($query_count) or die (mysql_error());
// troviamo il numero delle pagine che dovr� essere contato
$pagine = $p->contaPagine($count, $max);
// limitiamo la SELECT al numero di risultati per pagina
$obj_titolo = @mysql_query(
"SELECT * FROM
annunci INNER JOIN cliente ON (annunci.clienteid=cliente.id )
INNER JOIN modello ON (annunci.modelloid=modello.id)
INNER JOIN users ON (annunci.user_id=users.id)
WHERE
modello.modello='azioni' ORDER BY `id_annunci` DESC LIMIT ".$inizio.",".$max) or die (mysql_error());
//recuperiamo i dati da stampare
while ($row = mysql_fetch_array($obj_titolo)) {
$click_annuncio = $row['click_annuncio'];
$id_annunci = $row['id_annunci'];
$user_id = $row['id'];
$messaggio = substr($row['messaggio'], 0, 25);
$mq = $row['mq'];
$tipologia = $row['tipologia'];
$titolo = $row['titolo'];
$tipo = $row['tipo'];
$locali = $row['locali'];
$username = $row['username'];
$email = $row['email'];
$cliente = $row['cliente'];
$logo_cliente = $row['logo_cliente'];
$nome_file = $row['nome_file'];
$tipo_file = $row['tipo_file'];
$dati_file = $row['dati_file'];
$nome_file_vero = $row['nome_file_vero'];
$tipo_file = $row['tipo_file'];
$dati_file = $row['dati_file'];
//recuperiamo i dati da stampare
// stampiamo i nostri dati
echo" <h5><table width='90%'>";
echo" <tr>";
echo" <p class='three'><td colspan='3'></td>";
echo" </tr>";
echo" <tr>";
echo" <td width='14%' bgcolor='#FFFFFF'> <a href=\"rannunci_fin.php?id=$id_annunci\"/>[img]immagini2.php?id_annunci=$id_annunci[/img]</a></td>";
echo" <td width='85%' bgcolor='#FFFFFF'><table width='100%'>";
echo" <tr>";
echo" <td>$titolo
$tipologia
</td>";
echo" </tr>";
echo" <tr>";
echo" <td> <a href=\"rannunci_fin.php?id=$id_annunci\"/><button class=\"button orangeButt\">Vai alla notizia</button></td>";
echo"</tr>";
echo" <tr>";
echo" <td></td>";
echo" </tr>";
echo" </table>";
echo" <td></td>";
echo"</tr>";
echo"</table><hr /></h5>";
}
//l'errore dovrebbe essere qui chi mi aiutaaaaaa
//mostriamo le pagine
$lista = $p->listaPagine($_GET['p'], $pagine);
echo $lista . "
";
//mostriamo il navigatore Precedente/Successiva
$navigatore = $p->precedenteSuccessiva($_GET['p'], $pagine);
echo $navigatore;
?>
Con quest'altro printo la notizia in un'altra pagina, e in questo caso le è à ù ò ecc si vedono così NPD societa’
Codice PHP:
<?php
require ("db_connect.php");
$id_annunci=$_GET['id'];
$query = mysql_query ("SELECT * FROM
annunci INNER JOIN cliente ON (annunci.clienteid=cliente.id)
INNER JOIN modello ON (annunci.modelloid=modello.id)
INNER JOIN users ON (annunci.user_id=users.id)
WHERE id_annunci=$id_annunci LIMIT 1");
if (!$query) {
exit('
Error performing query: ' . mysql_error() . '</p>');
}
while ($row = mysql_fetch_array($query)) {
$user_id = $row ['id'];
$titolo = $row ['titolo'];
$anno = $row ['anno'];
$id_annunci = $row ['id_annunci'];
$ts = $row ['ts'];
$messaggio = substr($row['messaggio'], 0, 2000);
$dotazione = substr($row['dotazione'], 0, 500);
$strumentazione = substr($row['strumentazione'], 0, 500);
$telefono = substr($row['telefono'], 0, 25);
$modello = $row ['modello'];
$mq = $row ['mq'];
$locali = $row ['locali'];
$prezzo = $row ['prezzo'];
$tipologia = $row ['tipologia'];
$tipo = $row ['tipo'];
$altro = $row ['altro'];
$condizioni = $row ['condizioni'];
$name = $row ['name'];
$citta = $row ['citta'];
$cliente = $row ['cliente'];
$logo_cliente = $row ['logo_cliente'];
$regione = $row ['regione'];
$provincia = $row ['provincia'];
$comune = $row ['comune'];
$via = $row ['via'];
$cap = $row ['cap'];
$anno = $row ['anno'];
$societa = $row ['societa'];
$email = $row ['email'];
$nome_file = $row ['nome_file'];
$tipo_file = $row ['tipo_file'];
$dati_file = $row ['dati_file'];
$nome_file2 = $row ['nome_file2'];
$tipo_file2 = $row ['tipo_file2'];
$dati_file2 = $row ['dati_file2'];
$nome_file3 = $row ['nome_file3'];
$tipo_file3 = $row ['tipo_file3'];
$dati_file3 = $row ['dati_file3'];
$nome_file4 = $row ['nome_file4'];
$tipo_file4 = $row ['tipo_file4'];
$dati_file4 = $row ['dati_file4'];
$nome_file5 = $row ['nome_file5'];
$tipo_file5 = $row ['tipo_file5'];
$dati_file5 = $row ['dati_file5'];
}
?>
<?php
$jokelist = mysql_query ("UPDATE annunci SET click_annuncio = click_annuncio + 1 WHERE id_annunci='$id_annunci' " ) or die (mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title><?php echo "$titolo ";?></title>
<meta name="description" content="<?php echo "$tipologia";?>"/>
<head>
<link href="login.css" rel="stylesheet" type="text/css" />
<link href="rannunci.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen, projection"/>
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="css/ie.css" media="screen" />
<![endif]-->
<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.dropdownPlain.js"></script>
<style type="text/css">
body{ font-size:18px; color:#FFF; }
a { color:#FFF}
.classname { border:solid 1px #585657; text-align:dx; background:#ffffff; padding:100px 50px 100px 50px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;}
/* =Your Generated css
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
.classname{-moz-box-shadow: 3px 10px 37px #000;-webkit-box-shadow: 3px 10px 37px #000;box-shadow: 3px 10px 37px #000;}
/* End of Your Generated css
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
</style>
</head>
<body>
<div class="container">
<div class="header"><?php require "header.php" ; ?>
<table width="1050">
<tr>
<td width="1050"><?php require "menutab.php" ; ?>
</td>
</tr>
</table>
</div>
<div class="sidebar1">
<?php require "medium_home1.php" ; ?>
<hr />
<?php require "medium_home2.php" ; ?>
<hr />
<?php require "menu_rannunci_dx.php" ; ?>
</div>
<div class="content">
<table width="740">
<tr>
<td width="740"><?php echo "[img]immagini2.php?id_annunci=$id_annunci[/img]"; ?></td>
</tr>
<tr>
<td><?php require "condividi.php" ; ?></td>
</tr>
<tr>
<td>
<?php echo "
<h2>[b]$titolo</h2>[/b]</p>";?></td>
</tr>
</table>
<table width="740" height="7">
<tr>
<td>
<?php echo "
[b] <h3>Data Articolo: $anno</h3>[/b]
<h3>[b]$tipologia[/b]
</h3></p>";?></td>
</tr>
<tr>
<td><?php echo "
<h4>[b]$messaggio[/b]</h4></p>";?></td>
</tr>
</table>
<table width="734">
<tr>
<td width="726" align="left" ><?php echo "
<h4>[b] Riferimento annuncio: Finanza $id_annunci[/b]</h4></p>";?></td>
</tr>
</table>
Chi riesce gentilmente a spiegarmi il perchè ???? le query sono pressoché uguali ... e non capisco ...