antiblock
https://arwen2.global/
  • Chatbox

    You don't have permission to chat.
    Load More
  • 0
LuizDavi

htdocs

Question

alguem poderia me ajudar a resolver um erro na hora de conectar o xampp com o mysql.

<?php 
    /*
    |-------------------------------------------------------------------
    | Datenbank Connection Details
    |-------------------------------------------------------------------
    */
        $mysql_host     = "25.51.96.100";
        $mysql_user     = "rancoroso";
        $mysql_pass     = "123456";
        $mysql_db    = "account";
    /*
    |-------------------------------------------------------------------
    | Datenbank Verbindung herstellen
    |-------------------------------------------------------------------
    */    
        mysql_connect($mysql_host, $mysql_user, $mysql_pass) OR
        die("Es konnte keine Verbindung zur Datenbank hergestellt werden.<br /> Fehlermeldung: ".mysql_error());    
        
        mysql_select_db($mysql_db) OR
        die("Die Datenbank konnte nicht benutzt werden.<br /> Fehlermeldung: ".mysql_error());
?>

está dando esse erro

Print

Edited by LuizDavi
Adicionado Imagem (see edit history)

Share this post


Link to post
Share on other sites

3 answers to this question

  • 0

Muito provavelmente estás a executar a versão mais recente do xampp que vem com PHP 7.3. Funções MySQL já ficaram obsoletas desde o PHP 7+.

 

Tens de usar mysqli ou pdo.

Share this post


Link to post
Share on other sites
antiblock
https://arwen2.global/
  • 0
2 minutos atrás, Karbust disse:

Muito provavelmente estás a executar a versão mais recente do xampp que vem com PHP 7.3. Funções MySQL já ficaram obsoletas desde o PHP 7+.

 

Tens de usar mysqli ou pdo.

Pode me ajudar ? 

Share this post


Link to post
Share on other sites
  • 0
Agora, LuizDavi disse:

Pode me ajudar ? 

A documentação tem tudo explicado.

 

https://www.php.net/manual/en/book.mysqli.php

https://www.php.net/manual/en/book.pdo.php

 

Nesse script só precisas de alterar mysql para mysqli e a ordem dos argumentos. Não vou dar ajuda para uma coisa básica que está disponível na documentação, e no google, se tivesses procurado...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now