Hello!
This is working.
I just want to ask how I should change the script so that every time somebody is clicking on a picture the related column "clicks" in the database is added with one(1) ? (Default value is 0)
<p>4 Random pics:<br>
<TABLE border="0">
<TR>
<?PHP
$dbh=mysql_connect ("localhost", "user3", "qawsed") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("pictures");
for ($i = 0; $i < 4; $i++ ) {
$query = "SELECT * FROM table1 WHERE id = '" . $array[$i] . "'";
$result = mysql_query($query) or die("error: ".mysql_error());
?>
<TD>
<? $mysql_array = mysql_fetch_array($result); ?>
<A HREF="<?echo $mysql_array["url"]?>">
<img src="<?echo $mysql_array["picname"]?>" border="0"></A><br>
<center><?echo $mysql_array["pictext"]?></center>
</TD>
<?}?>
</TR>
</TABLE>