I want to display last login time in php
<p>To display last login time..</p>

<p>i want to save login time to database in processlogin  page...and fetch that for next time in login page..</p>

<p>i got current date and time correctly by using</p>

<pre><code>$dt=date("m/d/y G:i:s&lt;br&gt;", time());
</code></pre>

<p>nd now i want to save <code>$dt</code> to database for that i have write below code</p>

<pre><code>$qdt = "select * from lastlogin";
    $rsLogin1 = $objdb-&gt;select($qdt);
if(rsLogin1 != null)
{
 $qaa = "update lastlogin set last='".$dt."'";
 $rsLogin12 = $objdb-&gt;select($qaa);
}
else
{
  $qa = "insert into lastlogin(last) values('".$dt."')";
    $rsLogin1 = $objdb-&gt;select($qa); 
}
</code></pre>

<p>when this page is running it show me </p>

<p><code>update lastlogin set last='11/08/12 15:00:07'</code> with statment wrong query</p>

<p>and when i copy and paste same query to my sql query...it give me correct result..</p>

<p>Can any one please help me that where i am wrong or what i have to do to solve this..</p>

<p>my database name is <code>lastlogin</code> and field is last which is <code>varchar(200)</code></p>

<p>Thanks in Advance</p>
