PDA

View Full Version : MySQL Newcomer needs help


Xko
02-01-2005, 03:40 PM
Hey folks,

First time i've used MySQL so please be gentle... :cool:

Well i have recently downloaded MyPHPVote bit of code for my site. Thing is i need to enter to information in a .php file but i'm unsure what it to put...

Here's where i get stuck...


<?php
$MySqlHostname = "localhost";
$MySqlUsername = "root";
$MySqlPassword = "";
$MySqlDatabase = "triphp";
$ServerConnect = mysql_connect("$MySqlHostname","$MySqlUsername","$MySqlPassword")or die ("Problem:Couldn't connect to MySQL Server.");
$DatabaseConnection = @mysql_select_db("$MySqlDatabase", $ServerConnect)or die("Problem: Couldn't select the $MySqlDatabase Database.");
?>


And it tells me to "Change the above lines according to my own config".

But what's my own config?

Any pointers would be much appreciated!

dmc
02-01-2005, 08:56 PM
Your own config means in this case your db.
You got yourself a mysql database in example called: triphp

Every database has a user and a pass

Db: triphp
user: dbuser
pass: dbpass

You have to fill these settings with your database name user and pass
$MySqlHostname = "localhost"; <-- localhost is its own server always default and the right settings

$MySqlUsername = "dbuser";
$MySqlPassword = "dbpass";
$MySqlDatabase = "triphp";

I hope this info will help

Xko
02-01-2005, 10:22 PM
Great! Thanks for that, seems relatively easier...for now.

Cheers bud. :thumbsup: