Set Same Time Zone in PHP & MySQL

Time Zones are important if you’re creating a social app which will include chat, social network and others which is interacted with the society. There are many time zones and you have to choose one to set in your server. I would totally recommend using UTC instead of your time zone in server. Web Server and Database server are different and they each have their own configuration. This includes the time zone too.

[READ MORE]

Connecting database to both mysqli and mysql entension

You can use both mysql and mysqli extension for executing SQL queries. Here is a tutorial on how to connect both the extensions to a database. Create a file named config.php where you will connect to the database. Put the following code in it: localhost“, “username“, “password“, “db“); if ($mysqli-connect_errno) {     echo “Failed to connect to MySQL: (” . $mysqli-connect_errno . “) ” . $mysqli-connect_error; } $bd = mysql_connect(“localhost“, “username“, “password“) or die(mysql_error());

[READ MORE]

Insert XML Data to MySQL Table Using PHP

This tutorial will help you to insert XML file’s contents to a MySQL Database table using php. Note- If you can’t open PHP files in browser in Ubuntu Linux See the Tutorial : http://subinsb.com/how-to-open-php-files-in-ubuntu-instead-of-downloading This is the XML data we are going to insert in to our MySQL Table. <span style="font-family: inherit;"<items></span <span style="font-family: inherit;" <item></span <span style="font-family: inherit;" <title>Google</title></span <span style="font-family: inherit;" <url>google.com</url></span <span style="font-family: inherit;" </item></span <span style="

[READ MORE]