jeppers Posted April 23, 2007 Share Posted April 23, 2007 i am using a an include statment to gain access to the database but it just won't play hear in my code so if you have any idea please help session_start(); include("database.php"); ______________________________________________________________ this is the entry to the database $conn = mysql_connect("localhost", "root", "mouse") or die(mysql_error()); mysql_select_db('pass', $conn) or die(mysql_error()); just dose not work but when i put the conection to the database in the form it works what is the problem Link to comment https://forums.phpfreaks.com/topic/48248-finding-it-hard-to-include-my-database/ Share on other sites More sharing options...
AndyB Posted April 23, 2007 Share Posted April 23, 2007 <?php session_start(); $conn = mysql_connect("localhost", "root", "mouse") or die(mysql_error()); mysql_select_db('pass', $conn) or die(mysql_error()); .... is identical to <?php session_start(); include("database.php");.... as long as database.php is in the same folder and looks exactly like this (note the php start and end tags): <?php $conn = mysql_connect("localhost", "root", "mouse") or die(mysql_error()); mysql_select_db('pass', $conn) or die(mysql_error()); ?> Link to comment https://forums.phpfreaks.com/topic/48248-finding-it-hard-to-include-my-database/#findComment-235907 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.