|
Alright.
So i'm trying to get this PHPscript to run on my website...
<?php $link = mysql_connect('XXXXXXX', 'mysql_XXXXXX', 'mysql_XXXXXXX') or die("Could not connect: ".mysql_error());
$db_select = mysql_select_db('XXXXXXXXX',$link) or die("Could not select: ".mysql_error());
$max =2;//Set this to how many images you have.
$d=date("z");
$query = "SELECT * FROM `updated`";
$result = mysql_query($query);
$l = mysql_fetch_array($result);
if($d > $l[0] || ($d == 0 && $l[0] == 365)){
$img = rand(1,$max);
$query = "UPDATE TABLE `updated` SET updated = $d && image = $img where updated= $l[0]";
$result = mysql_query($query);
$query = "SELECT * FROM `images` where image=$img";
$result = mysql_query($query);
$array = mysql_fetch_array($result);
echo '<a href="'.$array[2].'"><img src="images/'.$array[1].'" alt="Daily Image"></a>';
}
else{$query = "SELECT * FROM updated, images WHERE updated.image = images.image";
$result = mysql_query($query);
$array = mysql_fetch_array($result);
echo '<a href="'.$array[4].'"><img src="images/'.$array[3].'" alt="Daily Image"></a>';}
mysql_close($link);?>
I've already populated the necessary tables on MySQL. And i've even uploaded this PHPscript to my public_html directory using my FTP client.
I then place the PHPscript into my website page, and it's just supposed to work; Right?! but it isn't. So i'm confused here, and I don't know what i'm doing wrong.
__________________
Currently Reading: Please login or register to view this content. Registration is FREE
Last edited by Lashtal; 03-07-2008 at 10:22 PM..
|