Uncaught Error: Call to undefined function mysqul_pconnect

Hi there,
please forgive me for any unnecessary information or an improper post location, I'm just a non-web-developing amateur programmer trying to set up a website, and working backwards from the problem lead me here.

So I am in the process of repointing a site that is currently pointed at hostmonster to wix. In the process, however, I need to preserve 2 sub-directories of the site which will NOT be repointed. I've discovered I can accomplish this by turning the sub-directories (sitename,com/subdirectory) into sub-domains (subdirectory,sitename,com), and I managed to convert 1 sub-directory no problem.

The second sub-directory, however, uses so apparently outdated sql functions that are giving me some trouble. this error in particular:

Fatal error : Uncaught Error: Call to undefined function mysql_pconnect() in /[root folder]/Connections/mainthing.php:9 Stack trace: #0 /[root folder]/[subdirectory name]/Index_Page.php(1): require_once() #1 {main} thrown in /[root folder]/Connections/mainthing.php on line 9

And here is the relevant file referenced by that error:

# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_ = "localhost";
$database_ = [database];
$username_ = [username];
$password_ = [password];
$mainthing = mysql_pconnect($hostname_, $username_, $password_) or trigger_error(mysql_error(),E_USER_ERROR);

the last line being the aformentioned line 9 that seems to be causing the error. I read some documentation about how mysql functions are outdated and I should instead use "msqli" or "PDO" (which I tried and failed to implement), but I'm skeptical that is the crux of the problem given that this whole site was running just file with mysql functions up to this point.

I assume (and, again, maybe I'm going down the wrong rabbit hole here) the problem is that this code establishes a static website address (www,sitename,com) and then simply tacks the subdirectory (/subdirectory) onto the end of that address whenever it tries to open pages on this particular subdirectory. So when I change the address to subdirectory,sitename,com it still tries to go to www,sitename,com/subdirectory and crashes. The problem is, I'm not sure I quite understand how or where that is happening and how I can change it?

Thanks very much for your time, hopefully that's enough relevant information to answer my question.