Board Logo

Dynamic Data Solution with IE problem
nutsnbolts - 4/8/2008 at 02:42 AM

Had a friend help me with this dynamic data solution but I have not been able to get a hold of him to deal with this question.
Modified scroll.html as recommended and modified scroll.tpl0.php as follows.

Code:

<?PHP

$host = 'mydbhost';
$user = 'iusername';
$pass = 'pswd';
$name = 'dbname';

$cnn = mysql_connect($host, $user, $pass) or die ('Error connecting to mysql');
mysql_select_db($name);

$query = "SELECT * FROM ts WHERE status='active' ORDER BY id_num ASC LIMIT 8";
$result = mysql_query($query) or die('Error');
$num_rows = mysql_num_rows($result);

?>

var LOOK = {
// scroller box size: [width, height]
'size': [120, 110]
},

BEHAVE = {
// autoscroll - true, on-demand - false
'auto': true,
// vertical - true, horizontal - false
'vertical': true,
// scrolling speed, pixels per 40 milliseconds;
// for auto mode use negative value to reverse scrolling direction
'speed': 2
},

ITEMS = [
<?php
while($row = mysql_fetch_object ( $result ) ){
if($i == $num_rows){
echo "{'file': '','content': '$row->content','pause_b': 2,'pause_a': 0}";
}else{
echo "{'file': '','content': '$row->content','pause_b': 2,'pause_a': 0},";
$i++;
}
}
mysql_free_result($result);
mysql_close();
?>]


Function of script is (supposed) to grab content from table "ts"
Table has 8 rows with fields for id content and status.
if status =active content is shown otherwise it is supposed to just loop through the fields shown as active.

Works fine in FF but no show in IE Suspect script is inserting comma before closing bracket but don't know enough php to know how to check that or change it. If anyone could help I would be most appreciative

TIA


nutsnbolts - 4/8/2008 at 05:33 AM

Ok, the problem is the comma before the closing bracket in ITEMS eg:

Code:

var LOOK = { // scroller box size: [width, height] 'size': [120, 110] },

BEHAVE = { // autoscroll - true, on-demand - false 'auto': true, // vertical - true, horizontal - false 'vertical': true, // scrolling speed, pixels per 40 milliseconds; // for auto mode use negative value to reverse scrolling direction 'speed': 2 },

ITEMS = [ {'file': '','content': 'Thank you for stopping by..... Check back soon','pause_b': 2,'pause_a': 0},{'file': '','content': 'We Are Under Construction Your Mileage May Vary','pause_b': 2,'pause_a': 0},{'file': '','content': 'Downtown Savannah Store Now Open
14 West State Street','pause_b': 2,'pause_a': 0},{'file': '','content': 'Tips and tricks from our professionals','pause_b': 2,'pause_a': 0},{'file': '','content': 'Members only area with chat and forums','pause_b': 2,'pause_a': 0},{'file': '','content': 'Live WebCam from our new downtown location','pause_b': 2,'pause_a': 0},]


Any suggestions?

TIA


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/