Junior PHP Developer Question:
Download Job Interview Questions and Answers PDF
Tell me how can we connect to a MySQL database from a PHP script?
Answer:
To be able to connect to a MySQL database, we must use mysql_connect() function as follows:
<!--?php $database = mysql_connect("HOST", "USER_NAME", "PASSWORD"); mysql_select_db("DATABASE_NAME",$database); ?-->
<!--?php $database = mysql_connect("HOST", "USER_NAME", "PASSWORD"); mysql_select_db("DATABASE_NAME",$database); ?-->
Download Junior PHP Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Explain me is multiple inheritance supported in PHP? | Tell me what does the scope of variables means? |