Sorry, I've forgot one line. :)  Anyway, I think this code would only work if 
your database contains at least one image.

Regards, 

[ simon.cpu ]


<?php

// CORRECTED CODE:

    // how many seconds do you want your image to display?
    $interval = 5;
    
    if(!isset($_GET['ptr'])) {
        $ptr = 1;
    }

    $link = mysql_connect("localhost", "user", "pass"); // your connection 
string;
    mysql_select_db("foo");
    $query = "select name, description from images where id = 'x' limit $ptr, 
1";
    $result = mysql_query($query, $link);
    if(!($row = mysql_fetch_object($result))) {
        $ptr = 1;
        $query = "select name, description from images where id = 'x' limit 
$ptr, 1";
        $result = mysql_query($query, $link);
        $row = mysql_fetch_object($result);
    }

    echo "<InvalidTag http-equiv=\"refresh\" content=\"$interval; 
slideshow.php?ptr=" . ($ptr + 1) . "\" />";    
    echo "<img src=\"{$row->name}\" alt=\"{$row->description}\" />";
?>


p.s.: House of Fusion filters the meta string in my post.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207732
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to