Re: mysqliconnect issue
| From: | Chris | Date: | Tue, 17 Jun 2008 02:49:15 +0000 |
| Subject: | Re: mysqliconnect issue | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275464@lists.php.net to get a copy of this message | ||
Jason Pruim wrote:
> Okay, So I'm going to just assume that my issue is the fact that I'm
> tired... and my mind won't work properly.
>
> [Mon Jun 16 22:27:58 2008] [error] PHP Warning: mysqli_connect()
> expects parameter 5 to be long, string given
>
> Now parameter 5 is the database name, I echoed out each of the
> parameters and everything looks right...
>
> here's the line that's causing the problem:
>
> mysqli_connect($link, $server, $username, $password, $database)
> or die('Connection failed in dbmysqliconnect.php');
No, #5 is the port number (http://www.php.net/mysqli_connect).
You want:
$link = mysqli_connect($server, $user, $pass, $dbname);
$link can't be passed to mysqli_connect because it doesn't exist yet ;)
--
Postgresql & php tutorials
http://www.designmagick.com/