Jump to content

DEFAULT PHPMYADMIN


pranshu82202

Recommended Posts

Can anyone tell me what does default means in phpMyandmin Database...

 

I want to store timestamp automatically whenever user registeres to my site... can i do it by just selecting timestamp in the default column of the databse table..

 

Whether i need to write something in registration.php to insert the timestamp (which i set in the default column of my php databse)...

 

Thanxx for your keen interest...

 

-pranshu.a.11@gmail.com

Link to comment
Share on other sites

If you are talking about the "default" property for fields, yes that is the default value to be applied when a new record is created if one is not set when the record is created. So, if I have a field called 'active' with a default value of '1' then I can create new records without setting a value for that field and they will default to 1.

 

I don't know about your version of PHPMyAdmin, but in mine if I set a field type to "timestamp" there is a checkbox that appears right below the default value text box which states states "CURRENT_TIMESTAMP". Just check that field and the field will automatically be set to the timestamp at the time the record is created - assuming you don't pass a value for the field.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.