Hot Summer Deals are Here!
Celebrate with up to 99% off on 17,900 resources
00
Days
11
Hours
41
Mins
26
Secs

Help MYSQL/Database

Status
This thread has been locked.

iSoModPvP

Owner of DareMC
Premium
Feedback score
0
Posts
643
Reactions
124
Resources
0
I dont know where to put my database username and password and database name
at Anyone Able to help me out
This is really confusing


$db_selected = mysql_select_db('csgo', $link);
mysql_query("SET NAMES utf8");

function fetchinfo($rowname,$tablename,$finder,$findervalue) {
if($finder == "1") $result = mysql_query("SELECT $rowname FROM $tablename");
else $result = mysql_query("SELECT $rowname FROM $tablename WHERE `$finder`='$findervalue'");
$row = mysql_fetch_assoc($result);
return $row[$rowname];
}
?>
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Jack

Retired Moderator
Supreme
Feedback score
11
Posts
1,209
Reactions
1,462
Resources
0
I dont know where to put my database username and password and database name
at Anyone Able to help me out
This is really confusing


$db_selected = mysql_select_db('csgo', $link);
mysql_query("SET NAMES utf8");

function fetchinfo($rowname,$tablename,$finder,$findervalue) {
if($finder == "1") $result = mysql_query("SELECT $rowname FROM $tablename");
else $result = mysql_query("SELECT $rowname FROM $tablename WHERE `$finder`='$findervalue'");
$row = mysql_fetch_assoc($result);
return $row[$rowname];
}
?>
Definitely shouldn't be using the MySQL extension in php, it's deprecated and will be removed in the future (because security issues).

Better to use PDO_MySQL instead.

The database name goes in the mysql_select_db(), where it says 'csgo'

Also, you didn't give much info but there should be a config file or a pretty clear place to put your information in.
If not, there should at least be a call to mysql_connect() which is where you would put your user, pass, host, etc.
 
Status
This thread has been locked.
Top