SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Threaded View

  1. #1
    Can we go to a 48 hour day?
    Join Date
    May 2002
    0 Post(s)
    0 Thread(s)

    trouble with mysqli & fetch_assoc()

    I am trying to move some code to php5 & mysqli objects and I am running into a problem with getting a row in an associative array.

    The keys to not seem to be coming over correctly. I have included the code I am using and the var_dump() of one of the rows I get back from the $result->fetch_assoc() line.

    PHP Code:
      $query "SELECT * FROM news WHERE Topic LIKE '$topic' ORDER BY Date DESC" ;
    $result $this->mysqli->query($query);
    $returned_ID = array();
                 while ( 
    $row $result->fetch_assoc() ) {
    $returned_ID[] = $row['ID'];
    // end while rows returned       
    return $returned_ID
    var_dump result - (this is a news story I am pulling from the database with fields ID, date, category, title, and body)
    array(5) { [" B"]=> string(2) "51" [""]=> string(10) "2004-11-14" [" @"]=> string(3) "All" [""]=> string(15) "EMAIL BACK UP!!" [""]=> string(726) " Due to a power outage hosing our email server late Thrus. night we had to move to a new system. It is in place and the link to your email from the front page will work to get you to the new system.

    Your username is the same, please either email me from another account or call me at 810-441-6454 (cell) to get your new password.

    I am still working on recovering the old email messages and I will get those to everyone as soon as I can save what I can.

    I cannot apologize enough for this trouble and if there is anything I can do to help ease the trouble this has caused don't hesitate to ask.

    Rick Hading
    The MSU/FAME Tech Team
    Last edited by deuce868; Nov 23, 2004 at 16:30.
    "Techies just think a little differently least that is what they keep telling me."


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts