hello guys i am really struggling with the new mysqli thing
for example if i had:
$testinfo = "SELECT * from players where username = $player";
$testinfo1 = mysql_query ($testinfo) or die ("Could not query players");
$testinfo2 = mysql_fetch_array ($testinfo1);
what would be the mysqli equivalent
Thank you
mysqli
Re: mysqli
The "i" is imperative as it's MySQLi.Caroll09 wrote:hello guys i am really struggling with the new mysqli thing
for example if i had:
$testinfo = "SELECT * from players where username = $player";
$testinfo1 = mysql_query ($testinfo) or die ("Could not query players");
$testinfo2 = mysql_fetch_array ($testinfo1);
what would be the mysqli equivalent
Thank you
Code: Select all
$testinfo = "SELECT * from players where username = $player";
$testinfo1 = mysqli_query ($testinfo) or die ("Could not query players");
$testinfo2 = mysqli_fetch_array ($testinfo1);
http://www.php.net//manual/en/book.mysqli.php
http://codular.com/php-mysqli
Re: mysqli
The "i" is imperative as it's MySQLi.
Code: Select all
$testinfo = "SELECT * from players where username = $player";
$testinfo1 = mysqli_query ($testinfo) or die ("Could not query players");
$testinfo2 = mysqli_fetch_array ($testinfo1);
so the only thing that changes is the 'i'?Be sure to make use of MySQLi's prepared statements too.
http://www.php.net//manual/en/book.mysqli.php
http://codular.com/php-mysqli
Re: mysqli
Mostly yes, I suggest learning it. Not just guessing as you might get unexpected results.Caroll09 wrote:The "i" is imperative as it's MySQLi.
Code: Select all
$testinfo = "SELECT * from players where username = $player"; $testinfo1 = mysqli_query ($testinfo) or die ("Could not query players"); $testinfo2 = mysqli_fetch_array ($testinfo1);
so the only thing that changes is the 'i'?Be sure to make use of MySQLi's prepared statements too.
http://www.php.net//manual/en/book.mysqli.php
http://codular.com/php-mysqli
- Sharlenwar
- Posts: 523
- Joined: Mon May 28, 2012 7:14 pm
Re: mysqli
I have found the mySQLi stuff is different. Very different from the old way. You also want to move to what PHP5 is doing with their somewhat object orientated stuff.
In this thread I use mySQLi: http://indie-resource.com/forums/viewto ... 4&start=10
Hope it helps? Plus I'm not expert, just some nobody.
In this thread I use mySQLi: http://indie-resource.com/forums/viewto ... 4&start=10
Hope it helps? Plus I'm not expert, just some nobody.
Deep within the Void of Quasion, a creation.
**My Corner of the Web**
***NEW***GrindFest - My own PHP/MySQL game!
Sharlenwar's Adventures
Torn-City - Massively multiplayer online text based RPG
**My Corner of the Web**
***NEW***GrindFest - My own PHP/MySQL game!
Sharlenwar's Adventures
Torn-City - Massively multiplayer online text based RPG