lerix20 0 Newbie Poster

Hello Guys,

Please i have finding it very hard to convert this javascript snippet to php where values or content can be retrieved from DB. SELECT SQL Statement to retrieve the value from the DB is listed below. I also attached an external script (scroller.js) to make the scroller run. Please any help....Will be grateful.

<script type="text/javascript">                                                                                      var pausecontent=new Array()                    

        pausecontent[0]='<p align="justify"></p><p style="text-align: justify; font: 13px candara; line-height: 19px; margin-top: -20px;"><span style="font: bold 15px Trebuchet MS">06-02-12</span> <span style="font-size: 17px;"><strong>-</strong></span> <strong>Id-el Maulud Celebrations....</strong> The school will be closed on Monday 6th February 2012 to observe the public holiday marking the Id-el Maulud celebration.</p><div class="read_more"></div><br />'

        pausecontent[1]='<p align="justify"></p><p style="text-align: justify; font: 13px candara; line-height: 19px; margin-top: -20px;"><span style="font: bold 15px Trebuchet MS">18-02-12</span> <span style="font-size: 17px;"><strong>-</strong></span> General PTA Meeting and Parents Day celebration will come up on Saturday 18-2-12 within the school premises. Time: 10a.m-12 noon (General PTA Meeting) and 12.15 - 3p.m (Parents Day). <br />Please plan to attend.</p><div class="read_more"></div><br />'

        pausecontent[2]='<p align="justify"></p><p style="text-align: justify; font: 13px candara; line-height: 19px; margin-top: -20px;"><span style="font: bold 15px Trebuchet MS">02-01-12</span> <span style="font-size: 17px;"><strong>-</strong></span> <strong>Book Care</strong>: We do prefer that all books be kept in the school during holidays to minimize loss and damage. Please  kindly return all books to school after examination at the end of each term and make specific request for books you wish to keep at home, especially BEC 4-6. Visit <strong><em>THE COMMUNITY LEISURE LIBRARY, <span style="font-size: 11px;">House 336, Phase 3 (Near One Nigeria) Gwagwalada, Abuja</span></em></strong>, with assorted books for all reading pleasure.  </p><div class="read_more"></div><br />'

        pausecontent[3]='<p align="justify"></p><p style="text-align: justify; font: 13px candara; line-height: 19px; margin-top: -20px;"><span style="font: bold 15px Trebuchet MS">02-01-12</span> <span style="font-size: 17px;"><strong>-</strong></span> <strong>Bulk S.M.S:</strong>Once again we request that parents who do not recieve text messages from the school should endeavour and please send the following information: <p align="justify" style="font: bold 13px candara; margin-top: -13px; line-height: 18px;">(Jewels Name - Class - Parents telephone number (active))&nbsp;&nbsp; to <strong style=" font-size: 14px;">&nbsp;&nbsp;07035646471</strong> </p><p align="justify" style="font: bold 12px candara; margin-top: -4px; line-height: 18px;">N/B: Please do not send VISAFONE numbers. !!!</p></p><div class="read_more"></div><br />'

    pausecontent[4]='<p align="justify"></p><p style="text-align: justify; font: 13px candara; line-height: 19px; margin-top: -20px;"><span style="font: bold 15px Trebuchet MS">18-01-12</span> <span style="font-size: 17px;"><strong>-</strong></span> <strong>"Resumption 2012":</strong> Our sincere apologies on the adjustment of our resumption date from Monday 16th January to Monday 23rd January 2012. This was due to the recent National Events. Eagerly waiting to see our Jewels.</p><div class="read_more"></div><br />'



//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)

new pausescroller(pausecontent, "pscroller1", "someclass", 11000)                                               
</script>

<?php

$query = "select * from table ORDER BY ID";
$result = mysql_query($query) or die (mysql_error());

while ($row = mysql_fetch_array($result_banner))
{
    $id = $row['ID'];                       
    $,,, = $row[',,,'];     

echo '<a href="#"><img src='.$,,,.' width="631" height="243" /></a>';


?>          

Please help this code has been giving some headache, it might be am concatenating the script well.

Thanks and Best Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.