| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| MySQL question | |
|---|---|
| Tweet Topic Started: Jun 3 2005, 06:06 AM (647 Views) | |
| Jory | Jun 3 2005, 06:06 AM Post #1 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Ok, lets say I use
Now, lets say I get 20 results. And I want to display number 11 trough15. Would doing this:
Would that do what I want? And, could I use
(The name of the id col in the table is id) Of would I have to do
(of whatever the the number of the col would be) *Qj wonders if this made any sence :unsure: Well, if not, just tell me ![]() Damn, *Qj made typos :o (Big typos to :$ ) EDIT: Sani helped me with the first one. (he told me to use ) Thanks for that ![]() |
![]() |
|
| Fire Pheonix (PM) | Jun 4 2005, 06:03 AM Post #2 |
![]()
Too much pressure!
![]() ![]() ![]() ![]() ![]() ![]()
|
You would have to use $item['id'] and you could use it for all the other variables including say, $item['title'] (as long as the row, 'title' , was in the mySQL database) |
![]() |
|
| Rory | Jun 4 2005, 07:33 AM Post #3 |
|
i;m a mess
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Doesn't mysql_fetch_row() only return it as numeric based? to do it with the column headings, you'd have to do: mysql_fetch_assoc(), or mysql_fetch_array($result,MYSQL_ASSOC) but mysql_fetch_array() is like this: while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { echo $row['bob']; } |
![]() |
|
| Gornakle | Jun 4 2005, 07:57 AM Post #4 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
mysql_fetch_array(), by default, gets both number indices and associative indices (as in, the column name). In your case, using mysql_fetch_assoc() would probably be better. |
![]() |
|
| Jory | Jun 4 2005, 12:38 PM Post #5 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I know, just needed a quick example ![]() Anyway, thanks for the help. So if I'm getting this right, I can just turn mysql_fetch_array() into mysql_fetch_assoc and it will work? Yay
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
12:53 PM Jul 11
|



![]](../../../../0/1/0/p601690/pipright.png)






12:53 PM Jul 11