Jump to content

Parse error, but not what it looks like...


PC Nerd

Recommended Posts

[code=php:0]
/* numeric array */
$Stats = mysqli_fetch_array($Query, MYSQLI_NUM);

/* associative array */
$Stats = mysqli_fetch_array($Query, MYSQLI_ASSOC);

/* associative and numeric array */
$Stats = mysqli_fetch_array($Query, MYSQLI_BOTH);

[/code]

I'm guessing your missing an argument. Try one of those
Link to comment
Share on other sites

http://devzone.zend.com/manual/view/page/function.mysqli-fetch-array.html

[quote]mysqli_fetch_array() is an extended version of the mysqli_fetch_row() function. In addition to storing the data in the numeric indices of the result array, the mysqli_fetch_array() function can also store the data in associative indices, using the field names of the result set as keys.

    Note: Field names returned by this function are case-sensitive.

    Note: This function sets NULL fields to PHP NULL value.

If two or more columns of the result have the same field names, the last column will take precedence and overwrite the earlier data. In order to access multiple columns with the same name, the numerically indexed version of the row must be used.

The optional second argument resulttype is a constant indicating what type of array should be produced from the current row data. The possible values for this parameter are the constants MYSQLI_ASSOC, MYSQLI_NUM, or MYSQLI_BOTH. By default the mysqli_fetch_array() function will assume MYSQLI_BOTH for this parameter.

By using the MYSQLI_ASSOC constant this function will behave identically to the mysqli_fetch_assoc(), while MYSQLI_NUM will behave identically to the mysqli_fetch_row() function. The final option MYSQLI_BOTH will create a single array with the attributes of both. [/quote]
Link to comment
Share on other sites

thjis is what ive got:

$Stats = mysqli_fetch_array($Query, MYSQLI_BOTH);

now that  reutrns :

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\xampp\xampp\htdocs\Battle-Ages\B_A-Base.php on line 52
Link to comment
Share on other sites

Firstly, choosing to name your resultset $Query is a poor choice of variable name. Its not a query, its a resultset. Echo your query which you have so aptly named $General_Stats_SQL.

This will show you that you have an error in your sql syntax, this error is preventing mysqli_query from returning a resultset, then, because you fail to test your query actually works before trying to use the result, your getting your other errors.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.