bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

How to get the id from the second row? (Mysql)

(4 posts)
  • Started 1 year ago by Null
  • Latest reply from fel64
  • This topic is not resolved

Tags:

  1. 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 1 year ago #
  2. How are the results ordered now? How about showing the SQL?

    Posted 1 year ago #
  3. 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
    etc

    Or sometimes it's:
    Row 1 - id 7863 - tekst
    Row 2 - id 56557 - tekst
    Row 3 - id 665 - tekst
    etc

    Posted 1 year ago #
  4. $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?

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.