1

I'm trying to connect to a database online from a local website, but I got the first error 'connessione fallita'. It isn't a problem of configuration because if I try to use the same code online (it is an inc file) it works! How can i fix it?

<?php $connessione=@mysql_connect('ip','username','password');
if (!$connessione){
        echo('connessione fallita');
        exit();
    }
if (!@mysql_select_db('nameofthetable')){
        exit('la selezione database non ha funzionato');
    }
?>

Obviously I changed the values of 'ip', 'username', 'password', and table here for security reasons.

GabAntonelli
  • 757
  • 2
  • 9
  • 26

1 Answers1

0

Troubleshoot. Try to connect from command line or with a client. Check error returned(not php error message). most likely it is due to the user not having access from your IP.

AdrianBR
  • 2,762
  • 1
  • 15
  • 29