[ Rozwiązany] Mam problem z MySQL - błąd połączenia do bazy. error: Uncaught Error: Call to undefined function mysql_ connect( ) in C: \ xampp\ htdocs\ zarejestruj. php: 30 Stack trace: # 0 { main} thrown in C: \ xampp\ htdocs\ zarejestruj. php on line 30 oto cały kod. $ ip = filtruj( $ _ SERVER[ ' REMOTE_ ADDR' ] ) ;. You probably have a php7 in XAMPP - mysql_ * functions have been removed in PHP7. SO Q& A regarding mysql vs mysqli when using php. A solution to this problem seems to be both easy and strange (? ) alike: php - c / etc / php5/ cli/ php. Why do I have to specify the. PHP offers three different APIs to connect to MySQL. Below we show the APIs provided by the mysql, mysqli, and PDO extensions. Each code snippet creates a connection to a MySQL server running on " example. In case anyone else faces this, it' s a case of PHP not having access to the mysql client libraries. Having a MySQL server on the system is not.
Try to restart/ reload Apache ( I see that you use it) and check phpinfo( ). Then you restart Apache PHP reread configuration file ( php. # Fill our vars and run on cli. # $ php - f db- connect- test. i am getting uncaught error for call to undefined function mysql_ connect. Stack trace: # 0 { main} thrown in C: \ xampp\ htdocs\ sample\ mycoonect. In general you should not use mysql anymore more but rather the new improved version of mysql, called mysqli net/ manual/ de/ book.