1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting this query to work with xenforo code

Discussion in 'XenForo Development Discussions' started by Member 3639, Dec 17, 2011.

  1. Member 3639

    Member 3639 Active Member

    Basically i have this code
    while (
    $category $db->fetchAll("SELECT * FROM `articles_category` ORDER BY `category_name` ASC"))
    $mydata .= $category['category_name'];
    Which gives me an error of;
    ErrorException: Undefined index: category_name - library/EWRporta/Block/MyPhp/myfile.php:8

    What is the best way to "define" it?
  2. Mike Tougeron

    Mike Tougeron Well-Known Member

    That's basically saying that the field 'category_name' doesn't exist in the result. Have you tried doing a var_dump($category); to see what that holds?

Share This Page