hello
have the following scenario - i want to add php code into a javascript but whatever syntax i try seems to fail
here is my php code
$item = "";
$sql = "select * from news where news_ticker = 'yes' ORDER BY timestamp DESC LIMIT 10";
$rs = @mysql_query($sql,$conn);
while ($row = @mysql_fetch_array($rs)) {
$item .= "myScroller1.addItem(".$row['heading'].")";
and then in my javascript:
//SET SCROLLER APPEARANCE AND MESSAGES
var myScroller1 = new Scroller(294, 148, 438, 13, 0, 0); //(xpos, ypos, width, height, border, padding)
myScroller1.setColors("#4f4f4f", "#000000"); //(fgcolor, bgcolor, bdcolor)
myScroller1.setFont("Verdana,Arial,Helvetica", 1);
<? echo($item); ?>;
note the echo part have tried many ways but all seems to fail, what am i doing wrong?