Jump to content

Recommended Posts

Hey guys. Well, it's me again.

 

I have a question in mind, is there any way possible to create database tables and fields

using php script instead of manually creating it in database?

 

If so, if any of you have any resources about this, i hope you will share it with me :)

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/283890-php-script/
Share on other sites

 

 

I have a question in mind, is there any way possible to create database tables and fields

using php script instead of manually creating it in database?

Yes, but you still got to type out the queries manually for creating the databases/tables.

 

You're better of using some form of gui such as MySQL Workbench (desktop gui) or using phpMyAdmin (web based gui) to easily manage your MySQL server.

Edited by Ch0cu3r
Link to comment
https://forums.phpfreaks.com/topic/283890-php-script/#findComment-1458233
Share on other sites

Then you have four options at least:

 

  1. Use a MySQL TIMESTAMP type column which will automatically set to current date on INSERT and optionally on UPDATE
  2. Use a DATE type column and place CURDATE() into the column on INSERT
  3. USE a DATETIME column and place NOW() into the column on INSERT
  4. Use PHP to get current date and place that in the date column
Link to comment
https://forums.phpfreaks.com/topic/283890-php-script/#findComment-1458328
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.