tags:

views:

188

answers:

3

I just wanted a little bit of information on MYSQLI_NUM. And is it part of PHP or MySQL.

+1  A: 

It is a PHP constant used in mysqli_fetch_array()

This tells the function that you want it to return a record from your results as a numerically indexed array instead of an associative one (MYSQLI_ASSOC) or both (MYSQLI_BOTH).

Alternatively, you can just use mysqli_fetch_row() to do the same thing.

HorusKol
A: 

Google is your friend! ;) MYSQLI_NUM is a PHP constant used by the mysqli database extension;

http://uk3.php.net/manual/en/mysqli.constants.php

MatW
google is your friend or RTFM is not an answer ....
RageZ
My point was that the question was very easily answered by making some effort, rather than just asking for help. FYI, I feel the down-vote unnecessary as I didn't just say RTFM, I provided a link that contained the necessary answer.
MatW
+3  A: 

MYSQLI_NUM is a constant in PHP associated with a mysqli_result. If you're using mysqli to retrieve information from the database, MYSQLI_NUM can be used to specify the return format of the data. Specifically, when using the fetch_array function, MYSQLI_NUM specifies that the return array should use numeric keys for the array, instead of creating an associative array. Assuming you have two fields in your database table, "first_field_name" and "second_field_name", with the content "first_field_content" and "second_field_content"...

$result->fetch_array(MYSQLI_NUM);

fetches each row of the result like this:

array(
    0 => "first_field_content",
    1 => "second_field_content"
);

Alternatively...

$result->fetch_array(MYSQLI_ASSOC);

fetches an array like this:

array(
    "first_field_name" => "first_field_content",
    "second_field_name" => "second_field_content"
);

Using the constant MYSQLI_BOTH will fetch both.

Travis