• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Connecting to Mysql in Php

SoloQ

Hard With Style
Joined
Mar 12, 2009
Messages
557
Reaction score
20
Location
Netherlands ;3
Hello,

After a few years of no tibia I tried to setup an old project I was working on.
I downloaded Xampp and booted it all up.
My website was working as far as I can remember but when going to my bounty hunters page I got the following error:
Code:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\pages\bounty-hunter.php:2 Stack trace: #0 C:\xampp\htdocs\system\load.page.php(7): include() #1 C:\xampp\htdocs\index.php(37): include_once('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\pages\bounty-hunter.php on line 2

My .php says the following:
PHP:
@mysql_connect("localhost","user","pass");
@mysql_select_db("otserv");
Line 2 is the @mysql_connect

The rest of my website is still working, what code can I use to replace the manual input in this php script?

Pastebin of the .php
<?php @mysql_connect("localhost","user","pass"); @mysql_select_db("otserv"); - Pastebin.com (https://pastebin.com/88q6m2x2)
 
Solution
mysql_query() is truncated from the world of codes, to use that you need older versions of PHP installed.
what you need is mysqli_query() which is a bit different.

TheGahl

Learning in Progress
Joined
Jul 28, 2018
Messages
200
Solutions
3
Reaction score
124
mysql_query() is truncated from the world of codes, to use that you need older versions of PHP installed.
what you need is mysqli_query() which is a bit different.
 
Solution
Top