Jump to content

Search the Community

Showing results for tags 'warning: mysqli_fetch_array()'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hello everyone! Nice forum, runs real smooth I'm receiving the following error message: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given (this is on line 6) Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, null given (this is on line 14) The error is related to the following code: $sql = "SELECT username, avatar FROM users WHERE avatar IS NOT NULL AND activated='1' ORDER BY RAND () LIMIT 32"; $query = mysqli_query($db_conx, $sql); $userlist = ""; while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) { (this is line 6) $u = $row["username"]; $avatar = $row["avatar"]; $profile_pic = 'user/'.$u.'/'.$avatar; $userlist .= '<a href="user.php?u='.$u.'" title="'.$u.'"><img src="'.$profile_pic.'" alt="'.$u.'" style="width: 100px; height: 100px; margin: 10px;"></a>'; } $sql = "SELECT COUNT (id) FROM users WHERE activated='1'"; $query = mysqli_query($db_conx, $sql); $row = mysqli_fetch_row ($query); (this is line 14) $usercount = $row [0]; I'm not sure what's causing it, I know it seems to be a problem with a parameter that's not working right, I looked over the code, couldnt find it. I'm wondering if it could be a database issue? but I don't think so. This is a script to show user avatar images in a area of the page. It tells the system to show random user profile pictures if they are registered, activated and have an avatar image. ANY help would be highly appreciated, been trying to solve this for a while now, the rest of the website and script works perfectly so far and there's ALOT of it
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.