Forums

Join
bbPress Support ForumsTroubleshootingHow to get the id from the second row? (Mysql)

Info

Tags

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

  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

  2. How are the results ordered now? How about showing the SQL?

  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

  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?

  5. You must log in to post.