MySQL Forums
Forum List  »  PHP

Re: index/redirect problem on localhost/mysql
Posted by: Peter Brawley
Date: January 17, 2019 07:21PM

How are you trying to execute php scripts?

What does phpinfo() say about mysqli availability?

Once phpinfo() confirms your execution methods works for the mysqli api, test one step at a time, ie ...

When developing, always turn on error reporting

<?php
$debug=1;
error_reporting( E_ALL );
ini_set( "display_errors", $debug );

phpinfo();

$servername = "localhost";
$username = "zzzz";
$password = "zzzz";
$dbname = "zzzzz";

$conn = new mysqli( $servername, $username, $password,$dbname );
if( $conn->connect_error ) exit( "Connection failed: " . $conn->connect_error);
else exit( "Connected" );
?>

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.