Home » mysql
Hi friends,
I got the requirement to display the list of table names from the database using php code. I got the solution for it, once check the below code.
1) Connect to database:
mysql_connect(“dbserver”,”dbuser”,”dbpassword”);
2)Get the list of tables from table
$result = mysql_list_tables(“dbname”);
3)...
Hello friends,
The following query will add some times to mysql date column.
Get the today date :
$date = date(‘Y-m-d H:i:s’);
Convert it into strtotime and add which one we have to add, here i am going to add 30 minutes to existing time.
$newtime = strtotime($date . ‘ + 30 minutes’);
Covert the newtime to date format like...
Hello friends, I have code for how to create a excel file with mysql data using php code. By following 5 steps to create excel file.We can implement it in admin section of websites for user list excel file.
Follow the below steps to retrieve the data from database:
1) Connect to database:
1234567891011121314151617$dbhost= "Mysql server name";...
Hello friends,
The following script is for displaying the mysql connecting using php code and table schema using php code.
It will be useful when we want to know the total fields of table.
1) Connecting with mysql :
$db_host = “”; // Database hostname
$db_username=”"; // Database username
$db_password=”"; // Database...
Hi,
following is user table:
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fname` varchar(255) NOT NULL,
`mname` varchar(255) NOT NULL,
`lname` varchar(255) NOT NULL,
`createdat` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`birthday` date NOT NULL,
PRIMARY KEY (`id`)
);
insert one row into...
Filed in: mysql
















