KaiSheng Posted November 14, 2013 Share Posted November 14, 2013 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. Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted November 14, 2013 Share Posted November 14, 2013 (edited) I have a question in mind, is there any way possible to create database tables and fieldsusing 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 November 14, 2013 by Ch0cu3r Quote Link to comment Share on other sites More sharing options...
Barand Posted November 14, 2013 Share Posted November 14, 2013 there is an example here http://forums.phpfreaks.com/topic/282860-selectingsearching-rows-of-a-table-based-on-the-value-of-a-field-in-the-table/?do=findComment&comment=1453412 Quote Link to comment Share on other sites More sharing options...
KaiSheng Posted November 14, 2013 Author Share Posted November 14, 2013 Thank you. Quote Link to comment Share on other sites More sharing options...
KaiSheng Posted November 15, 2013 Author Share Posted November 15, 2013 But I need the current date instead of manually keying in the dates Quote Link to comment Share on other sites More sharing options...
Barand Posted November 15, 2013 Share Posted November 15, 2013 Then you have four options at least: Use a MySQL TIMESTAMP type column which will automatically set to current date on INSERT and optionally on UPDATE Use a DATE type column and place CURDATE() into the column on INSERT USE a DATETIME column and place NOW() into the column on INSERT Use PHP to get current date and place that in the date column Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.