In this Example, I have used some commonly used function in PHP with MySQL database. This PHP code is written in PHP5.0 with using MySQLi for connecting with database. After using this PHP page and MySQL Table you do not need to code again and again. just reuse it again in your program. so here are the coding ways.
First of all create db.php file and it will contain database information and some config parameters.
First of all create db.php file and it will contain database information and some config parameters.
All common functions are written into the db.php
Then here is one script (Usage Example)that how to use it in your php code.
require("databasefile.php"); $sql = "SELECT * FROM table_name"; 0) { while ($row = dbFetchAssoc($fetching)) { echo $row['field1']; echo $row['field2']; } } else { echo 'No result found'; } ?>Please Don't forget to leave a comment.
0 comments :
Post a Comment