Re: $db=new mysqli fails while $db=mysqli_connect succeeds in PHP/MySQL 5
| From: | Chris | Date: | Mon, 27 Aug 2007 01:25:37 +0000 |
| Subject: | Re: $db=new mysqli fails while $db=mysqli_connect succeeds in PHP/MySQL 5 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43946@lists.php.net to get a copy of this message | ||
Linux NG/Lists wrote:
From a php-general thread earlier: <?php $db=new mysqli('localhost','whil','secret','test'); ?> generates: Fatal error: Call to undefined function new mysqli() in index.php on line 24 while <?php $conn = mysqli_connect("localhost","whil","secret","test"); echo 'conn good: '.$conn.' :very good indeed<br>'; ?> generates success: conn good: Object id #1 :very good indeed The book I'm working with (PHP & MySQL Web Dev, Welling/Thompson) specifically defines the 'new mysqli' syntax. So I'm guessing I don't have something configured right?If one works the other should too. Your code here looks fine according to the manual (http://www.php.net/manual/en/function.mysqli-connect.php) - can you send us exactly what you have? -- Postgresql & php tutorials http://www.designmagick.com/