<div>Hi All</div>
<div>I have date field, I am storing it as &quot;int&quot; in table.</div>
<div>When I checked the table in database, the value shows as 1.</div>
<div> </div>
<div>My code is as below.</div>
<div> </div>
<div><strong><em>&#39;INSERT INTO {rs_table} ( uid, name, qualification, email, altemail, phone, altphone, dob, yrsofexp, prefworkloc) &#39;<br>      .&quot;VALUES (%d, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, <font color="#ff6600">&#39;%d&#39;</font>, &#39;%d&#39;, &#39;%s&#39;)&quot;, <br>
     $user-&gt;uid, <br>     $form_state[&#39;values&#39;][&#39;persname&#39;],<br>     $form_state[&#39;values&#39;][&#39;hqualif&#39;],<br>     $form_state[&#39;values&#39;][&#39;email&#39;],<br>     $form_state[&#39;values&#39;][&#39;altemail&#39;],<br>
     $form_state[&#39;values&#39;][&#39;phone&#39;],<br>     $form_state[&#39;values&#39;][&#39;altphone&#39;],<br><font color="#ff0000">    $form_state[&#39;values&#39;][&#39;birthdate&#39;],</font><br>    $form_state[&#39;values&#39;][&#39;yearsexp&#39;],<br>
    $form_state[&#39;values&#39;][&#39;prefloc&#39;]<br>  );</em></strong></div>
<div> </div>
<div>Whats the wrong here, is there any API I have to make use of to convert from date to int value??<br><br>Regards</div>
<div>Austin</div>
<div> </div>
<div> </div>
<div> </div>
<div class="gmail_quote">On Mon, Mar 28, 2011 at 8:36 AM, Austin Einter <span dir="ltr">&lt;<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>Hi All</div>
<div>I have a date field in my form.</div>
<div>How do I store/retreive the value into/from MySQL.</div>
<div> </div>
<div>On google search, I saw people are suggesting to use either &quot;int&quot; or &quot;datetime&quot; type.</div>
<div>Please suggest which one needs to be used.</div>
<div> </div>
<div>If I use int (I hope core uses int), while storing can I just store &quot;form[&#39;values&#39;][&#39;date1&#39;]&quot; as %d and while retreivin, what are the related apis to convert back to date.</div>
<div> </div>
<div>Regards</div>
<div>Austin.</div><font color="#888888">
<div> </div>
<div> </div></font></blockquote></div><br>