Hello Techyv Guys,
I need to have a sample coding for any PHP simple application with MYSQL connectivity. I need to have the coding in order to understand the connectivity coding of PHP with MYSQL. Please help me by providing me the same, if anyone can also provide any related article link, that will also help me.
Regards,
Michael D Dent
PHP simple application with MYSQL
PHP is a major language used in creating websites. And it uses the MySQL connectivity. MySQL is an open source database, which allows multi users to perform multiple actions. An advantage of building a website on a database is that you can run search queries on the database which would not be possible in case of html written website.
Here is a simple code of PHP with MySQL database.
You can look here for coding and articles/tutorials.
PHP simple application with MYSQL
Hi,
MySQL connectivity in PHP is quite straightforward. You need to connect to the MySQL at first. Then you need to choose the database. Then,you will have to mention the query and finally you need to fetch the data from the query. There is one more step as you need to close the connection finally. This seems to be quite similar to database connectivity in any other database software. However, in this case you need a simple connection string. You need to use following code:
<?PHPÂ
$username= "user_name";
$password="password";
$hostname="Local_Host"; Â
$dbHandle=myql_connect($hostname,$username,$password); … ?>
You can add any message for connection failure and success.
For selecting database you need to use mysql_select_db. You can compose query using mysql_query. You can fetch the data from query using mysql_fetch_array. You can close the database connection using mysql_close. This is the fundamental aspect. Now you can read a lot and do wonders using MySQL and PHP.
Waters Magner
PHP simple application with MYSQL
For establishing the connection between PHP and MySQL, you have create db_connnection.php connect mysql database with PHPfile and establish the connection in that file. Now test your connection by creating index.php file and adding the code in it. You can find the code here in this tutorial on how to