Jump to content

[SOLVED] include db connection?


ballhogjoni

Recommended Posts

How would you include the db connection info into another file? example:

 

<?php
$username="xxxx";
$password="xxxx";
$database="xxxx";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
mysql_close();
?>

 

<?php
include("xxxx.com/tests/xxxxx/config.php");
// the rest of the code
?>

 

for some reason this is not working dfor me. where am i going wrong?

Link to comment
https://forums.phpfreaks.com/topic/50559-solved-include-db-connection/
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.