<div>Hi All</div>
<div>I have date field, I am storing it as "int" 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>'INSERT INTO {rs_table} ( uid, name, qualification, email, altemail, phone, altphone, dob, yrsofexp, prefworkloc) '<br> ."VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', <font color="#ff6600">'%d'</font>, '%d', '%s')", <br>
$user->uid, <br> $form_state['values']['persname'],<br> $form_state['values']['hqualif'],<br> $form_state['values']['email'],<br> $form_state['values']['altemail'],<br>
$form_state['values']['phone'],<br> $form_state['values']['altphone'],<br><font color="#ff0000"> $form_state['values']['birthdate'],</font><br> $form_state['values']['yearsexp'],<br>
$form_state['values']['prefloc']<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"><<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>></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 "int" or "datetime" 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 "form['values']['date1']" 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>