Jump to content


MySQL Connect


  • Please log in to reply
2 replies to this topic

#1 Guest_PcGamerz13_*

Guest_PcGamerz13_*
  • Guests

Posted 17 March 2006 - 12:46 AM

Is anything wrong with this?

<?
mysql_connect("localhost","","") or die ("Unable to connect to MySQL server."); 
mysql_select_db("snipelegends") or die ("Unable to select requested database."); 
?>


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 March 2006 - 12:54 AM

[!--quoteo(post=355752:date=Mar 17 2006, 12:46 AM:name=PcGamerz13)--][div class=\'quotetop\']QUOTE(PcGamerz13 @ Mar 17 2006, 12:46 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Is anything wrong with this?

<?
mysql_connect("localhost","","") or die ("Unable to connect to MySQL server."); 
mysql_select_db("snipelegends") or die ("Unable to select requested database."); 
?>
[/quote]

$user="blah";
$host="localhost";
$password="blah";
$database = "blah";
mysql_connect($host,$user,$password);
mysql_select_db($database);

good luck
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 shortj75

shortj75
  • Members
  • PipPipPip
  • Advanced Member
  • 118 posts
  • LocationPort Huron,mi

Posted 17 March 2006 - 02:04 AM

your mysql connect should work fine once you put your userid and password in
<?
mysql_connect("localhost","userid","password") or die ("Unable to connect to MySQL server."); 
mysql_select_db("snipelegends") or die ("Unable to select requested database."); 
?>

The Short One

hopfully this helps if it doesn't sorry
i won't write the code for you!!! you don't learn that way




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users