我有这个脚本。它在 localhost 中可以正常工作,但我在主机服务器上遇到问题。
$query="SELECT t1.*, t2.*, t3.*,t4.*,t5.*,t7.asciiname as asciiname_t7, t8.asciiname as asciiname_t8,t9.*
FROM anunturi t1
INNER JOIN tranzactie t2 ON t1.tranzactie = t2.id_tranzactie
INNER JOIN tip_proprietate t3 ON t1.tip = t3.id_prop
INNER JOIN anunt_descriere t4 ON t1.id_anunt = t4.ext
INNER JOIN anunt_locatie t5 ON t1.id_anunt = t5.ext
INNER JOIN zone t9 ON t5.zona = t9.id_zona
INNER JOIN locatii t7 ON t5.judet = t7.admin1_code AND t7.feature_code='ADM1'
INNER JOIN locatii t8 ON t5.oras = t8.geonameid
WHERE t1.status=:arh ORDER BY t1.data DESC";
$stmt = $this->dbh->prepare($query);
$stmt->bindParam(':arh', $arh, PDO::PARAM_INT);
$stmt->execute();
$nr=$stmt->rowCount();
//echo $nr;
if($nr>0)
{
foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $result)
{
if($result['tip']=='1')
{
$camere=" - ".$result['camere'];
}
else
{
$camere="";
}
if($result['special']=='0' && $_SESSION['privilegiu']=='2') {
$special="<a href='#' id='".$result['id_anunt']."' onclick='special(this);'>special</a>";
$rest="<a href='#' id='".$result['id_anunt']."' onclick='mod(this);'>Edit</a> <a href='#' id='".$result['id_anunt']."' onclick='arhivare(this);'>Arhivare</a> ";
}
else
{
if($_SESSION['privilegiu']=='2') {
$special="<a href='#' id='".$result['id_anunt']."' onclick='nespecial(this);'>normal</a>";
$rest="<a href='#' id='".$result['id_anunt']."' onclick='mod(this);'>Edit</a> <a href='#' id='".$result['id_anunt']."' onclick='arhivare(this);'>Arhivare</a> ";
}
else
{
$special="";
$rest="";
}
}
$view[]="
<tr>
<td>".$result['id_anunt']."</td>
<td>".$result['den_tranzactie']."</td>
<td>".$result['den_prop'].$camere."</td>
<td>".$result['asciiname_t7']." ".$result['asciiname_t8']." ".$result['den_zona']."</td>
<td><input type='hidden' name='tip' id='i".$result['id_anunt']."' value='".$result['tip']."'><input type='hidden' name='tranz' id='e".$result['id_anunt']."' value='".$result['tranzactie']."'><a href='#' id='".$result['id_anunt']."' class='view' value='".$result['id_anunt']."' onclick='view(this);'>View</a> ".$rest.$special."</td>
</tr>";
}
}
else
{
$view[]="Nu exista oferte";
}
return $view;
}
我在我的本地主机服务器上测试了这个脚本,现在我无法使用它。我迫切需要它。提前致谢!