Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pass the Now() Function from one page to another in php
    primarykey
    data
    text
    <p>I am displaying the <code>timestamp=now()</code> from one page to another. How can I pass this function? As on the second page I want to retrieve the table on the basis of <code>timestamp=now()</code>. I have done this but it's not working. Kindly help me in this.</p> <p>Coding</p> <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt; function showCustomer(n) { var xmlhttp; 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) { document.getElementById("display").innerHTML=xmlhttp.responseText; } } alert(n); xmlhttp.open("POST","display.php?id="+ n,true); xmlhttp.send(); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form&gt; &lt;?php $s= 'now()'; echo $s; ?&gt; &lt;input type="button" value="h" name="s" onclick="showCustomer(&lt;?php $s ?&gt;)"&gt; &lt;div id='display' &gt; &lt;?php echo "111"; ?&gt; &lt;/div&gt; </code></pre> <p>I retrieve the data from the database through this coding:</p> <pre><code>&lt;?php include('config.php'); $sa="select * from table1 where timestamp=now()"; $result=mysql_query($sa) or die(mysql_error()); echo "&lt;table border='1'&gt; &lt;tr&gt; &lt;/tr&gt;";?&gt; &lt;?php while($row = mysql_fetch_array($result)) { $row['c1']; $row['c2']; $row['c3']; $row['c4']; } </code></pre> <p>I must call this table on button click on next page by also considering the Now() function. Kindly help me.</p>
    singulars
    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.
 

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