Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To answer your question, this is indeed very possible and fairly simply too.</p> <p>On the client/gadget side you will need to use javascript to make an ajax request to your server. when this request is made your server will simply access your SQL database and print it, creating the response to that ajax call. Here is an example using php as the server side language. Please Comment if you need help.</p> <p>Client side (javascript):</p> <pre><code>function GetContent(){ if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { var response = xmlhttp.responseText; document.getElementsById("RESULTS DIV").innerHTML = response //or something else to be done with response } } var time1 = new Date().getTime() xmlhttp.open("GET","PHP SERVER ADDRESS?time="+time1,true); // the time parameter is important to prevent caching the response - // your server code does not need to handle it. xmlhttp.send(); } </code></pre> <p>And The Server code in php</p> <pre><code> &lt;?php $con = mysql_connect("MYSQL SERVER ADDRESS","USERNAME","PASSWORD"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM TABLE_NAME"); while($row = mysql_fetch_array($result)) { echo $row['COLUMN NAME']; echo "&lt;br /&gt;"; } mysql_close($con); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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