Sorry not sure how you mean for me to show the code for syntax highlighting... but here's the code.
BTW, this is my first attempt at PHP so I'm quite a novice, the problem is probably obvious to someone with more experience 🙂
1st page where the echo statement works:
<?php
$layoutId = $cgi->getValue ( "id" );
$rows = $sql->execute ( "SELECT * FROM " . $property_table . " WHERE id=" .
$sql->quote ( $layoutId ) . " AND propertyshow=1 LIMIT 1",
SQL_RETURN_ASSOC );
$row = $rows [ 0 ];
$Price = number_format ( $row [ 'propertyprice' ] );
$sql->execute ( "UPDATE " . $property_table .
" SET propertyviews=(propertyviews + 1) WHERE id=" .
$sql->quote ( $layoutId ) . " LIMIT 1" );
$ThumbPhotoWidth = "53";
$ThumbPhotoHeight = "39";
?>
Here's the code for the page where it doesn't work:
<?php
require ( "../config.php" );
require ( "../CGI.php" );
require ( "../SQL.php" );
$cgi = new CGI ();
$sql = new SQL ( $DBusername, $DBpassword, $server, $database );
if ( ! $sql->isConnected () )
{
die ( $DatabaseError );
}
require ( "../CSQL.php" );
require ( "../lang/$language_pack/index.php" );
$layoutId = $cgi->getValue ( "id" );
$rows = $sql->execute ( "SELECT * FROM " . $property_table . " WHERE id=" .
$sql->quote ( $layoutId ) . " AND propertyshow=1 LIMIT 1",
SQL_RETURN_ASSOC );
$row = $rows [ 0 ];
$Price = number_format ( $row [ 'propertyprice' ] );
// This add a click to the property veiw total
$sql->execute ( "UPDATE " . $property_table .
" SET propertyviews=(propertyviews + 1) WHERE id=" .
$sql->quote ( $layoutId ) . " LIMIT 1" );
$ThumbPhotoWidth = "180";
$ThumbPhotoHeight = "135";
?>
There is other code on the page that works (various arrays for $features) but I don't think it's this that's stopping it working on the other page as they are not relevant to the other page.
Thanks, Chris