PHP Tutorials

PHP mysqli code example to search MySQL database

In the following PHP program I have accessed the MySQL database (using PHP’s object oriented mysqli extension ) by a PHP function generated by me, and fetched a “MySQL database table” column value (Departments column) based on some key value in another column ( Serial ). So in a nutshell this program shows how – based on “primary key column value” of a “particular row” of a “single database table”, pick up “another column value” of that row in the same table.