hi folks.
i am a bloody php beginner and have some troubles.
when i trie to put my mysqli_connect into a separate function
ie. function db_connect() - i am not able to parse the ressource.
for example:
function db_connect()
{
$dbc = mysqli_connect("localhost", "user", "password", "db_name");
return $dbc;
}
$db_conn = db_connect();
is there any possibility?
thx, dieter
mysqli_connect problem....
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
first i must ask you to use php code tags around your code. 2nd, how do you know its not being passed back? try to
3rd, why do you need to do that in the first place?
Code: Select all
var_dump($db_conn)