Problem when making a record in the database

0

Good, I have uploaded all the files to a free server, they are the databases, I have tried the files without problem via local with wamserver , but already uploads this problem when inserting data .

  

Warning: mysql_select_db () expects parameter 2 to be resource, boolean given in /home/u136011330/public_html/insertarweb/register.php on line 10       Warning: mysql_query () expects parameter 2 to be resource, boolean given in /home/u136011330/public_html/insertarweb/register.php on line 18       Error. Can not connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")

    
asked by vtrjavier 27.06.2017 в 04:21
source

1 answer

2

The official PHP page states:

  

Warning: This extension was obsolete in PHP 5.5.0, and was deleted   in PHP 7.0.0. Instead, the MySQLi extension should be used or   PDO_MySQL ...

I attach the link for more detail link

As it is possible that the version of PHP in the hosting that you are using is referring to this particular problem.

Since this is not the case, the solution may already be published in the STACK EXCHANGE community link , where the most accepted response expresses:

  

... when connecting to "localhost" the socket connector is used, but when connecting to "127.0.0.1" the TCP / IP connector is used. You can try using "127.0.0.1" if the socket connector is not enabled / working.

Obviously applying the IP corresponding to your particular case.

    
answered by 27.06.2017 / 04:41
source