I just installed xampp with php 7.3 / 7.2 and am test running it on my localhost. I can no longer connect to my database with the php 7.3. My code looks like this:
1 <?php
2 // ===============================================================
3 // customDBConnection.php
4 // ===============================================================
5 $db_server = 'localhost';
6 $db_name = 'crss';
7 $db_user = 'root';
8 $db_passwd = '';
9 // ------------------------------------------------
10 // Connect to DATABASE
11 // ------------------------------------------------
12 $db = mysql_connect($db_server, $db_user, $db_passwd);
13 mysql_select_db($db_name,$db);
The error that php throws is this:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\crss\customDBConnection.php:19 Stack trace: #0 C:\xampp\htdocs\crss\index.php(5): include() #1 {main} thrown in C:\xampp\htdocs\crss\customDBConnection.php on line 12
The above code has been running on my servers for years now without any problems.
Can someone of you help me?
Thank you.
George