Thanks for the help.. One more question... Sorry man I'm still a newbie here.
Ok follow this:
http://www.gspotracing.com/4x4rigs/showphoto.php/photo/75/sort/1/size/medium/cat/516/page/1
The link above changes everytime i click on the next image on my page, the only thing that changes in this link is where the number 75 is right now to another number.. In the code it shows that number as being called $next_image.
How can I substitute this $next_image to query the database as well.
chdir('/home/kyle/public_html/forums/');
require "./global.php";
$link = mysql_connect("localhost", "kyle_gspot", "raceit");
mysql_select_db("kyle_gspot", $link);
$sql=mysql_query("SELECT * FROM photos WHERE id='$photo'", $link);
$sql1=mysql_query("SELECT * FROM photos WHERE id='$next_image'", $link);
$result = mysql_fetch_assoc($sql);
$result1 = mysql_fetch_assoc($sql1);
if ($photo != ''){
$hdrtxt = "ShowPhoto ".$result['title'];
} else {
$hdrtxt = "ShowPhoto ".$result1['title'];
}
Would this work for a conditional statement?? Because no matter what, I can't get the query to run when the $next_image variable is changed to another number...