![]() |
|
#1
|
|||
|
|||
array variablesHi! I'd just like to ask a "simple"(but not for me) question....
PHP Code:
I'm kinda confused with this variable called $myrow, where do these $myrow[#] came from? does it only make sense if it was declared as $myrow[], or $myrow[4]... etc...?? thanks for those who will be glad to help. |
|||
|
#2
|
||||
|
||||
Re: array variablesSure it's for you too, as YOU are asking the question, and not whomever the other person "may be"...
But anyway, the variable $myrow becomes an array, as returned from the function mysql_fetch_row(). The $result is a "result row", returned as an enumerated array, from a known query, so the indexes correspond to the columns in the results. So, as arrays are zero-indexed, $myrow[0] relates to column0 (the first column) in $result, $myrow[1] to column1 (the second column) in $result, and continues through $myrow[N] to columnN in $result. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: array variablesproblem solved. thanks dude
|
|
#4
|
||||
|
||||
Re: array variablesAlso, take a look at the function: mysql_fetch_array(), as it allows the variable to be indexed with either a number -- as used in the first post, OR the field name itself (case-sensitive, though) within quotes (double or single -- I've seen both used).
There are examples at the link provided, above. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| return string from a function | Howard_L | C Programming Language | 4 | 18-Aug-2007 00:56 |
| How to sort in C++ alphabetically | wilen | C++ Forum | 5 | 20-Apr-2007 15:43 |
| Need help deleting the last element in the array | headphone69 | C++ Forum | 2 | 15-Mar-2006 20:31 |
| Pointer Usage in C++: Beginner to Advanced | varunhome | C++ Forum | 0 | 19-Aug-2005 10:25 |
| template comiling problems - need expert debugger! | crq | C++ Forum | 1 | 01-Feb-2005 22:26 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The