Question 13Asked in Bihar STET 2025 Paper II Computer Science, 7 Nov 2025, Shift 1 (9:00 AM)

How can you establish a connection between PHP and MySQL?आप PHP और MySQL के बीच एक कनेक्शन कैसे स्थापित कर सकते हैं?

आप PHP और MySQL के बीच एक कनेक्शन कैसे स्थापित कर सकते हैं?
  1. AUsing the "connect()" function in PHPPHP में "कनेक्ट()" फ़ंक्शन का उपयोग करना
  2. BBy including a PHP libraryPHP लायब्रेरी शामिल करके
  3. CBy embedding MySQL queries directly in PHP codePHP कोड में सीधे MySQL क्वेरीज़ एम्बेड करके PHP में
  4. DBy using the "mysqli_connect()" function in PHP"mysqli_connect()" फ़ंक्शन का उपयोग करके
Show answerHide answer

Correct answer: (D) By using the "mysqli_connect()" function in PHP"mysqli_connect()" फ़ंक्शन का उपयोग करके

Explanation

mysqli_connect(host, user, password, database) opens a connection from PHP to a MySQL server. PDO is the other common method. PHP has no generic connect() function for this.mysqli_connect(host, user, password, database) PHP से MySQL सर्वर का कनेक्शन खोलता है। PDO दूसरा आम तरीका है। PHP में इसके लिए कोई सामान्य connect() फ़ंक्शन नहीं है।

From Bihar STET 2025 Paper II Computer Science PYQ, 7 Nov 2025, Shift 1 (9:00 AM)

This is question 13 of Bihar STET 2025 Paper II Computer Science PYQ, 7 Nov 2025, Shift 1 (9:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.