1. PHP Programming for DB connection a. To connect to a database with a php program, given the hostname is “localhost”, username is “ericwei”, password is “bmccu”, db_name is “db350” what is the database connection statement in php if the returning value assigned to a variable $dbc? b. If the returning value of database connection statement is assigned to $dbc, what is the statement to execute a database selection statement “SELECT * FROM Customer;” for a returning variable of $r? c. If there are more than one records returned from the server, what is the PHP statement to loop through all the records and print out the column of first_name on the client side? (10 pts) d. Normally where you store the database connection php file? Why?
1. PHP
a. To connect to a
b. If the returning value of database connection statement is assigned to $dbc, what is the statement to execute a database selection statement “SELECT * FROM Customer;” for a returning variable of $r?
c. If there are more than one records returned from the server, what is the PHP statement to loop through all the records and print out the column of first_name on the client side? (10 pts) d. Normally where you store the database connection php file? Why? (5 pts)
![1. PHP Programming for DB connection
a. To connect to a database with a php program, given the hostname is
"localhost", username is “ericwei", password is “bmccu", db_name is
“db350" what is the database connection statement in php if the returning value
assigned to a variable $dbc?
b. If the returning value of database connection statement is assigned to $dbc, what
is the statement to execute a database selection statement “SELECT *
29
66
FROM
Customer;" for a returning variable of $r?
c. If there are more than one records returned from the server, what is the PHP
statement to loop through all the records and print out the column of
//
first name on the client side?
d. Normally where you store the database connection php file? Why? (5 pts)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F12dd5a44-3d0a-466b-a8f5-5c10b5667b82%2Fae6db930-08ab-420f-9247-538f5088cbcd%2Fzo5ynbx_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)