This is a discussion on "mysql_fetch_array()" within the PHP Forum section. This forum, and the thread "mysql_fetch_array() are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
mysql_fetch_array()
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
mysql_fetch_array()
I get this warning:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in DbConnector.php on line 43 from this code 40 //*** Function: fetchArray, Purpose: Get array of query results *** 41 function fetchArray($result) { 42 43 return mysql_fetch_array($result); 44 45} Is my syntax correct? Last edited by WebNinja; Jan 20th, 2008 at 03:21. |
|
|
|
||||
|
Re: mysql_fetch_array()
You would need to pass the resource pointer by reference. You can't pass it by value.
function fetchArray(&$result) { // etc... I can't see why you would do it this way though.. If you are just returning one array row, why not just call the mysql function into a variable?
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: mysql_fetch_array()
That way seems unnecessary, have you performed the query?
Depending on whether you want one row or many rows i can post the basic way this is achieved.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mysql_fetch_array - problem displaying results | jswebdev | PHP Forum | 4 | Oct 15th, 2005 17:01 |