Eugene Posted January 21, 2007 Share Posted January 21, 2007 [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 Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted January 21, 2007 Author Share Posted January 21, 2007 could you explain about the 2nd argument in all of those queries..... not the $query..... becauase i dont know what thise meanthanks Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted January 21, 2007 Share Posted January 21, 2007 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] Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted January 21, 2007 Author Share Posted January 21, 2007 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 Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted January 21, 2007 Share Posted January 21, 2007 I heard of some bugs in mysqli could it have something to do with that? Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted January 21, 2007 Author Share Posted January 21, 2007 i dont know.... thats why im posting here Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted January 21, 2007 Share Posted January 21, 2007 Echo out the query itself Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted January 21, 2007 Author Share Posted January 21, 2007 i used echo $Query..... NO OUT PUT...?the error is on the line after the query is sent ( i echod using the line in between.... ( so the error is on line 53))any more suggestions Quote Link to comment Share on other sites More sharing options...
trq Posted January 21, 2007 Share Posted January 21, 2007 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. Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted January 21, 2007 Author Share Posted January 21, 2007 thanks, thats working ;D Quote Link to comment Share on other sites More sharing options...
Destruction Posted January 22, 2007 Share Posted January 22, 2007 Cannot delete own posts for some reason... Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 Because they can be helpful to other people later on. There's no need to delete posts :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.