Jump to content

database_connect.php


knox

Recommended Posts

[code=php:0]<?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.");
?> [/code]

Most of the time the the host is local host.

Hope that helps,
Tom
Link to comment
https://forums.phpfreaks.com/topic/14788-database_connectphp/#findComment-59063
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.