0

I am trying to insert time format(12:45) in a form designed by using php language.I want to insert time format in the text field. my database table name is store_login_time. Table field is same "time".

<input type="text" name="time" id="time" value="<?php echo $time?>"/>

here php script is used to store value in database. My database table name is "login_time" and table field is "time" format type is "TIME" Please help me I am poor in php.

1
  • To help you, you need to give us some more details. Commented Mar 1, 2014 at 5:49

2 Answers 2

2

you can display time using

<input type ="text" id="time" name="time" value="<?php echo date("h:i:s A")?>"/>

SQL Query like

INSERT INTO login_time(time) VALUES("<?php $_get['time']?>")

I think it helps to you.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you Jalpesh it works it gives the current time in the text field.Thank you once again..
0

You can get time Format by using this:

<input type="time" name="time"/>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.