📖 generic · 12th TN - English Medium · COMPUTER APPLICATION · Page 138example

Connecting PHP and MYSQL · Part 2

Chapter 9: Chapter 9 · COMPUTER APPLICATION

and MySQL Program: <?php $servername = “localhost”; $username = “username”; $password = “password”; $dbname = “ ”; $connection = (‘$servername ‘, ‘$username’, ‘$password’,’$dbname’); if ( ()) { echo “Failed to connect to MySQL: “ . (); } = “SELECT * FROM ”; //SQL select query $result = ($connection,$ );//execute SQL statement$rows = ($result);// get number of rows returned if ($rows) { while ($row = ($result)) { echo ‘ID: ‘ . $row[‘id’] . ‘<br>’; echo ‘Full Names: ‘ .

$row[‘ ’] . ‘<br>’; echo ‘Gender: ‘ . $row[‘gender’] . ‘<br>’; echo ‘Contact No: ‘ .

$row[‘ ’] . ‘<br>’; echo ‘Email: ‘ . $row[‘email’] . ‘<br>’; echo ‘City: ‘ .

$row[‘city’] . ‘<br>’; echo ‘Country: ‘ . $row[‘country’] . ‘<br><br>’; } } ($connection); //close the database connection ?> In the above code the SQL query retrieves two records from student table in school database.

These records are populated into client browser using PHP scripting language. version CHAPTER version CHAPTER - - - - According to recent Survey, approximately million websites are running PHP stack as of January . Of course, this count is likely to be even higher today given the widespread use of PHP in web designing and development. Facebook technology stack consist of application written in many language, including PHP and many others.

Facebook still uses PHP but it has built a compiler for it so it can be turned into native code. Facebook has many things built in PHP. Actually it’s not the real PHP, Facebook has written alternative version of PHP that is, HipHop’s HPHP’c which help to convert PHP code into C++. PHP has also attracted the development of many software frameworks that provide building blocks and a design structure to promote rapid application development (RAD).

Some of these include PRADO, CakePHP, Symfony, CodeIgniter, Laravel, Yii Framework, Phalcon and Zend Framework, offering features similar to other web frameworks. PHP is Open source & Community support scripting language PHP is a server-side scripting language designed for Web development. Seventy Percentage of Website has been built by PHP and MySQL Major of the webservers can

Related topics

Have a question about this topic?

Get an AI answer grounded in your actual textbook — with the exact page reference.

Ask AI about this topic →