Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay MySQL database using JQuery
    text
    copied!<p>Is it any way to display MySQL Database using JQuery? I want to display each data in a range time (for example 5 seconds) and then change automatically to other data.</p> <p>I have this data</p> <pre><code>ID Name Text 1 Iqbal Text from Iqbal 2 Yudi Text from Yudi 3 Zizan Text from Zizan </code></pre> <p>It should be like this</p> <pre><code>Iqbal Text from Iqbal </code></pre> <p>and after 5 seconds, it will change to</p> <pre><code>Yudi Text from Yudi </code></pre> <p>and so on.</p> <p>I have tried using JQuery, but i am facing difficult to use it with data that already fetched in PHP code. Is it any way to call <strong>fetched data</strong> from PHP and <strong>display it in JQuery</strong>? <br><br></p> <p><strong>This is php/MySql code</strong></p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;body&gt; &lt;div class="boxed" style="height:200px; border:1px solid #CCCC99; background:#CCCC99; overflow-x:hidden; overflow-y:scroll;"&gt; &lt;?php $con=mysqli_connect("localhost","","",""); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM jos_news ORDER BY id DESC"); echo "&lt;div id='news'&gt; &lt;table border='0' height='175px' width='180px' cellpadding='5' cellspacing='0' style='border-radius:10px; border:1px solid #FFFFFF; background-color:#FFFFFF;' &gt;"; while($row = mysqli_fetch_array($result)) { echo "&lt;tr&gt; &lt;td align='right'&gt;&lt;b&gt;". $row['Text'] ."&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;"; } echo "&lt;/table&gt;&lt;/div&gt;"; mysqli_close($con); ?&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>and this is jquery script</strong></p> <pre><code> &lt;script type="text/javascript" src="http://hna-consulting.com/hafizi-associates/templates/template_v5/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; SliderInt=1; SliderNext=1; $("document").ready(function(){ $(".boxed #news").fadeIn(10000); startSlider(); }); function startSlider(){ loop = setInterval (function(){ $(".boxed #news").fadeOut(300); },3000) } &lt;/script&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload