RE: [PHP-DB] $db=new mysqli fails while $db=mysqli_connect succeeds in PHP/MySQL

2007-08-27 Thread Instruct ICC
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.'

RE: [PHP-DB] $db=new mysqli fails while $db=mysqli_connect succeeds in PHP/MySQL

2007-08-27 Thread Instruct ICC
I don't see a constructor for mysqli at http://php.net/mysqli; My bad. It's right there at the top. Must be a case of the Mooondayz. _ Now you can see troubleĀ…before he arrives

Re: [PHP-DB] $db=new mysqli fails while $db=mysqli_connect succeeds in PHP/MySQL 5

2007-08-27 Thread Linux NG/Lists
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

[PHP-DB] Integer in DB becomes string in PHP?

2007-08-27 Thread hjfg sdfdsf
hello, I have a table test_table with one column: number int(11) (also see phpmyadmin database dump at the end of this mail). it has two values, 123 and 150. i select and output one of those numbers using the following code: --- php code start --- ? error_reporting(E_ALL);

RE: [PHP-DB] Integer in DB becomes string in PHP?

2007-08-27 Thread Daevid Vincent
You could use intval($row['number']); to force it, but be careful that you may hit upper bounds around 2 Billion as integers are always signed in PHP (unfortunately), and mysql lets you store unsigned. It'll also depend on your OS. If you're checking the value only, you can use