Jump to content


Photo

database_connect.php


  • Please log in to reply
1 reply to this topic

#1 knox

knox
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 16 July 2006 - 08:35 PM

How do I make this file??? I do not understand. I'm using PHPMyAdmin for database management, how do I generate this file? ???

#2 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 16 July 2006 - 08:43 PM

<?php   
# the next 4 lines you can modify 
$dbhost = 'yourhost'; 
$dbusername = 'dbusername'; 
$dbpasswd = 'yourpwd'; 
$database_name = 'nameofdatabase'; 

#under here, don't touch! 
$connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd")  
    or die ("Couldn't connect to server."); 
$db = mysql_select_db("$database_name", $connection) 
    or die("Couldn't select database."); 
?>

Most of the time the the host is local host.

Hope that helps,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users