Info
- 4 posts
- 3 voices
- Started 4 years ago by Null
- Latest reply from fel64
- This topic is not resolved
How to get the id from the second row? (Mysql)
-
- Posted 4 years ago #
Hi,
I have a query and it shows me 5 results
Now, I always need the id from row 2 (result 2). How to get it?
Greetz
-
- Posted 4 years ago #
How are the results ordered now? How about showing the SQL?
-
- Posted 4 years ago #
I am at work so can't show the query :)
The results are always different, but I need the id from the sec row no matter what the outcome is...
So sometimes it's:
Row 1 - id 23 - tekst
Row 2 - id 12 - tekst
Row 3 - id 44 - tekst
etcOr sometimes it's:
Row 1 - id 7863 - tekst
Row 2 - id 56557 - tekst
Row 3 - id 665 - tekst
etc -
- Posted 4 years ago #
$data = $bbdb->query('stuff'); $what_you_want = $data[1]->column_name;If I recall correctly.
$data[1]should be the second item (0-based arrays), which is an object. Access its property by the name of the column the ID is stored in. bbdb is based on ezSQL. Look for some documentation. It's actually pretty well documented for wpdb; did you not find anything there? -
You must log in to post.