Alright, i'm making my own site in wish i use php/mysql so therefore i need to make a connection. Since my connection details changes from my pc to my host i though of making a
conn.php file to include in my other files which i could change. It looks something like this...
conn.phpcode:
<?php
$conn = mysql_connect("localhost", "user", "pass") or die ("Problem connecting to Database");
mysql_select_db("dbname", $conn);
.....
?>
other.phpcode:
<?php
include (conn.php);
.....
?>
but when i do:
code:
$query_string = "select * from table";
$result = mysql_query($query_string, $conn);
it gives an error that
$conn isn't declared. So i was just looking for some insight, or if there's a better way of doing it.
Thx in advance