View Image

[insert_php] // Create connection
$con=mysqli_connect("localhost","flynn_cpuser","richsuz2014","flynn_coppermine0");

// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$pid=$_GET['pid'];
$query="SELECT * FROM cpg132_pictures WHERE pid=".$pid;
$result = mysqli_query($con,$query);
$count=0;
while($row = mysqli_fetch_array($result)) {
$hits=$row['hits']+1;
$query2="UPDATE cpg132_pictures SET hits=".$hits ." WHERE pid=".$pid;
$result2 = mysqli_query($con,$query2);
echo ''.$row["title"].'';
echo "
";
echo 'Viewed: '.$hits.' times';
echo "
";
echo ' ';
echo "
";

}

mysqli_close($con);

[/insert_php]

<< Back to album