2020-07-16, 03:59 PM
Hi, there
I'm using a simple php script for advertising which is connected to the mysql db.
Here the script:
I'm using a simple php script for advertising which is connected to the mysql db.
Here the script:
<?php
$mysql_hostname = "localhost"; //host
$mysql_user = "mybb"; //user
$mysql_password = "sdl209a"; //pass
$mysql_database = "mybb"; //db
$link = mysqli_connect($mysql_hostname,$mysql_user,$mysql_password,$mysql_database) or die("Error " . mysqli_error($link));
$get = mysqli_query($link,"SELECT * FROM ads WHERE size='468x60' ORDER BY RAND() LIMIT 0,1");
while($row = mysqli_fetch_assoc($get))
{
$link = $row['link'];
$banner = $row['image'];
$name = $row['name'];
echo "<a target='_blank' href='$link' rel='nofollow' title='$name' alt=''><img src='$banner' title='$name' width='468px' height='60px' style='border: 0px' /></a>";
}
@mysqli_free_result($get);
@mysqli_close($link);
?>
I want to make this script to get the mysql_user, mysql_password and mysql_database directly from the config.php