Call to undefined function mysql_connect()

06/05/2021 14:34 yanharazra2#1
Hello all.
I've been getting this error
Call to undefined function mysql_connect(). whenever I try to run a LC website through xampp, one is working but 2 others give that error. so I was wondering if I need to make a function somewhere or maybe I'm missing something.
would appreciate the help.
06/05/2021 17:20 Wizatek#2
The old mysql functions can not be used anymore, unless you use php4

[Only registered and activated users can see links. Click Here To Register...]
06/07/2021 10:57 theDJ-scripts#3
In the most cases you can just replace "mysql_" with "mysqli_". If this also don't work, just check out your php.ini for extension=php_mysql.dll (or .so or without an extension, without # at the beginning). If you continue to have problems, please feel free to contact us.
06/07/2021 22:31 Ih˘săs123#4
Quote:
Originally Posted by theDJ-scripts View Post
In the most cases you can just replace "mysql_" with "mysqli_". If this also don't work, just check out your php.ini for extension=php_mysql.dll (or .so or without an extension, without # at the beginning). If you continue to have problems, please feel free to contact us.
Object oriented correct but procedural false, there you always have to give the connection:

PHP Code:
mysql_query($sql); 
to

PHP Code:
mysqli_query($con$sql); 
You can try PDO-MYSQL too.