Questo è il risultato che ho ottenuto:
Codice PHP:
<?php require_once('../Connections/localhost.php');
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$maxRows_Articoli = 10;
$pageNum_Articoli = 0;
if (isset($_GET['pageNum_Articoli'])) {
$pageNum_Articoli = $_GET['pageNum_Articoli'];
}
$startRow_Articoli = $pageNum_Articoli * $maxRows_Articoli;
mysql_select_db($database_localhost, $localhost);
$query_Articoli = "SELECT * FROM articoli ORDER BY art_data DESC";
$query_limit_Articoli = sprintf("%s LIMIT %d, %d", $query_Articoli, $startRow_Articoli, $maxRows_Articoli);
$Articoli = mysql_query($query_limit_Articoli, $localhost) or die(mysql_error());
$row_Articoli = mysql_fetch_assoc($Articoli);
if (isset($_GET['totalRows_Articoli'])) {
$totalRows_Articoli = $_GET['totalRows_Articoli'];
} else {
$all_Articoli = mysql_query($query_Articoli);
$totalRows_Articoli = mysql_num_rows($all_Articoli);
}
$totalPages_Articoli = ceil($totalRows_Articoli/$maxRows_Articoli)-1;
$query_Articoli = "SELECT * FROM articoli ORDER BY art_data DESC";
$Articoli = mysql_query($query_Articoli, $localhost) or die(mysql_error());
$row_Articoli = mysql_fetch_assoc($Articoli);
$totalRows_Articoli = mysql_num_rows($Articoli);
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Full post</title>
<style type="text/css">
<!--
.Stile1 {color: #FD0303}
.Stile2 {font-size: 13px}
.Stile4 {font-size: 13px; color: #636363; }
.Stile5 {color: #636363}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="60%" border="1" align="center">
<tr>
<th scope="col">Id</th>
<th scope="col">Immagine</th>
<th scope="col">Titolo</th>
<th scope="col">Sottotitolo</th>
<th scope="col">Articolo</th>
<th scope="col">Data</th>
<th scope="col">Autore</th>
<th scope="col">Email</th>
<th scope="col">Categoria</th>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Articoli['art_id']; ?></td>
<td><img src="<?php echo '../caneclla/uploadtest' .$row_Articoli['art_immagine']; ?>" align="middle" /> </td>
<td><?php echo $row_Articoli['art_titolo']; ?></td>
<td><?php echo $row_Articoli['art_sottotitolo']; ?></td>
<td><?php echo $row_Articoli['art_articolo']; ?></td>
<td><?php echo $row_Articoli['art_data']; ?></td>
<td><?php echo $row_Articoli['art_autore']; ?></td>
<td><?php echo $row_Articoli['art_email']; ?></td>
<td><?php echo $row_Articoli['art_categoria_articolo']; ?></td>
</tr>
<?php } while ($row_Articoli = mysql_fetch_assoc($Articoli)); ?>
</table>
</form>
<tr><td valign="top"> </td>
</tr>
</body>
</html>
<?php
mysql_free_result($Articoli);
?>
Credo che l'errore sia nella riga:
<img src="<?php echo '../caneclla/uploadtest' .$row_Articoli['art_immagine']; ?>" align="middle" />
Non riesco proprio a capire....ho provato anche a sostituire gli apici con le virgolette....ma nulla (la directory "caneclla/uploadtest" è nella root ed i file sono correttamente memorizzati)