PHP Classes

php8 myqsl_pconnect: xampp php 8 mysql_pconnect not working

Recommend this page to a friend!
  All requests RSS feed  >  php8 myqsl_pconnect  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

php8 myqsl_pconnect

Edit

Picture of Srini Kb by Srini Kb - 10 months ago (2023-09-25)

xampp php 8 mysql_pconnect not working

This request is clear and relevant.
This request is not clear or is not relevant.

+1

xampp php 8, mysql_pconnect not working

  • 1 Clarification request
  • 1. Picture of ASCOOS CMS by ASCOOS CMS - 4 months ago (2024-03-18) Reply

    the mysql_pconnect function does not exist in MySQLi.

    If you want to use a permanent connection, you can use the mysqli_real_connect function Here an example:

    <?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "myDB";

    // Initialization $conn = mysqli_init();

    if (!$conn) {

    die('mysqli_init failed');
    

    }

    if (!mysqli_real_connect($conn, 'p:' . $servername, $username, $password, $dbname)) {

    die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
    

    }

    echo 'Success... ' . mysqli_get_host_info($conn) . "\n";

    mysqli_close($conn); ?>

    There is also another way to check if there is still a connection, using mysqli_ping.

    Ask clarification

    1 Recommendation

    PHP MySQL to MySQLi: Replace mysql functions using the mysqli extension

    This recommendation solves the problem.
    This recommendation does not solve the problem.

    +1

    Picture of Manuel Lemos by Manuel Lemos Reputation 23985 - 8 months ago (2023-11-14) Comment

    Hello, mysql_pconnect function was removed from PHP before PHP 7.

    You may want to change your code to use the PHP class above to use mysqli functions instead.


    Recommend package
    : 
    :