PDA

View Full Version : I.E. error using php/mysql where clause and fadeinslideshow



markaid
03-06-2010, 11:14 AM
1) Script Title: Ultimate Fade-in slideshow (v2.1)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm


3) Describe problem: I thought I'd post this just in case anyone else had the same problem getting images from a mysql database and finding it did not work in I.E. giving this error:

get(...)complete is null or not an object fadeslideshow.js

My guess is it is an overhead problem - taking too long to go through a where clause and finding a link to an image directory



imagearray: [

<?php

include('linktodb.php');
$query="SELECT * FROM database WHERE condition='met'";//this line caused the problem
$result=mysql_query($query);



while ($row=mysql_fetch_assoc($result)){


$url=$row[url];
$text=$row[text];
$image=$row[image];
{
echo "['http://mydomain.com/images/$image','$url','', '$text'],\n\r";
}
}

?>
['http://mydomain.com/gifs/loading.GIF','contact.html','','some text here for contacting - just an example of text. <a href=\'contact.html\'>CONTACT US</a>']

],

I replaced the above with


imagearray: [

<?php

include('linktodb.php');
$query="SELECT * FROM database";//this line no longer contains a where clause
$result=mysql_query($query);



while ($row=mysql_fetch_assoc($result)){


$url=$row[url];
$text=$row[text];
$image=$row[image];
$condtion=$row[condition];//this line and next added in place of Where clause
if($condition=='met'{
echo "['http://mydomain.com/images/$image','$url','', '$text'],\n\r";
}
}

?>//php tag ends
//next line outside php tags and is last in the array as a convenience so comma is left out as required by script
['http://mydomain.com/gifs/loading.GIF','contact.html','','some text here for contacting - just an example of text. <a href=\'contact.html\'>CONTACT US</a>']

],

Hope this helps someone