Thread: Update code
View Single Post
  #4  
Old 13th October 2019, 22:05
MicroMonkey's Avatar
MicroMonkey MicroMonkey is offline
Senior Member
 
Join Date: Jun 2016
P2P
Posts: 52
Default
you need to connect the database. you have to create a database variable. You can use yakpro, but it wont fix deprecated code
I can only use TT as an example, but it should look like this, $GLOBALS is a php universal
Quote:
$GLOBALS["DBconnector"] = mysqli_connect($mysql_host, $mysql_user, $mysql_pass) or die('DATABASE: mysqli_connect: ' . mysqli_error($GLOBALS["DBconnector"]));
mysqli_select_db($GLOBALS["DBconnector"],$mysql_db) or die('DATABASE: mysqli_select_db: ' . mysqli_error($GLOBALS["DBconnector"]));
this is the original so you can see how I put it together, its simple
Quote:
mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die('DATABASE: mysql_connect: ' . mysql_error());
mysql_select_db($mysql_db) or die('DATABASE: mysql_select_db: ' . mysql_error());
I created the DBconnector as a variable. You can name it what you want. Check for any deprecated functions by turning on display errors in your php config. You will be happier at the end of the day

each()
mysql_result()

the above are deprecated, emulate the function if you need to

Last edited by MicroMonkey; 13th October 2019 at 23:27.
Reply With Quote