mysql not working with php

0 votes

 I'm using Apache2, php5, and MySQL. Every time I try to run any database action in PHP, all scripts stop.

In the php.ini, I did enable the following :

extension=php_mysql.dll
extension=php_mysqli.dll    

The code to test the database:

echo '<p>testinp php script</p>'; 


// mysqli
$mysqli = new mysqli("localhost", "root", $pw, $db);

echo 'Still here<br>';

$result = $mysqli->query("SELECT * from test");
$row = $result->fetch_assoc();
print_r ($row);


echo 'Still here'; 

The "Still here" message is not displayed. How can I fix this?

Jun 24, 2022 in PHP by narikkadan
• 63,600 points
401 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
0 answers

Pinterest login with PHP and cURL not working

I've been trying to use cURL to ...READ MORE

Aug 5, 2022 in PHP by Kithuzzz
• 38,000 points
1,869 views
0 votes
1 answer

Connection with MySQL server using PHP. How can we do that?

Hey @kartik, You have to provide MySQL hostname, ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,840 points
1,295 views
0 votes
1 answer

How to convert from MySQL datetime to another format with PHP?

Hello, To convert a date retrieved from MySQL ...READ MORE

answered May 19, 2020 in PHP by Niroj
• 82,840 points
3,523 views
0 votes
0 answers

Getting PHP registration form to connect with MYSQL

I'm building a test site and my ...READ MORE

May 30, 2022 in PHP by Kichu
• 19,040 points
500 views
0 votes
0 answers

Why is PHP session_destroy() not working?

Why is session_destroy() not working? Is there any other way ...READ MORE

Jun 12, 2022 in PHP by narikkadan
• 63,600 points
1,358 views
0 votes
0 answers

PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client

I'm running MySQL version 8 on PHP ...READ MORE

Jun 18, 2022 in PHP by narikkadan
• 63,600 points
1,163 views
0 votes
0 answers

Can anyone confirm that phpMyAdmin AllowNoPassword works with MySQL databases?

I have a version of phpMyAdmin located ...READ MORE

Jun 3, 2022 in PHP by Kichu
• 19,040 points
988 views
0 votes
0 answers

How to open php files through localhost?

I am creating a student management program ...READ MORE

Jun 10, 2022 in PHP by narikkadan
• 63,600 points
1,230 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
10,540 views
0 votes
1 answer

Why is not preferable to use mysql_* functions in PHP?

The reasons are as follows: The MySQL extension: Does ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,250 points
1,268 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP