PHP mysqli support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ok, turns out, after double checking my servers mysqli support using phpinfo(), and doing a bit more research, and finding the following bit of introductory/instructional/tutorial material, relating to the mysqli PHP extension, on the php.net site itself, that other sample code I had found a little while back was just incorrect syntactically itself - making use of object oriented coding/approach, but excluding necessary keywords, like new, etc., but anyway:
http://www.php.net/manual/en/intro.mysqli.php

In other words, whereas it had said:
$sql = mysqli("hostName", "user", "password", "database");

it should in fact have stated:
$sql = new mysqli("hostName", "user", "password", "database");

That meant you could then access properties and methods of the then instantiated mysqli object using the -> operator, so, for a simple example of a statement, instead of mysqli_close($sql); it would instead read $sql->close();

In other words, it primarily makes use of an object oriented approach to database integration/manipulation, instead of the simple, procedural only approach of just calling functions all the time, but anyway.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux