Jump to content

Search the Community

Showing results for tags 'warning: mysql_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. Hi everyone: I'm having a problem with trying to iterate thru MySQL using PHP. I use MySQL select MAX(page_id) ... to get an integer for $MAX (//biggest id record in the table) and MYSQL select MIN(page_id)... to get an integer for $MIN (//smallest id record in the table) Then I use this loop to iterate thru 100 records at a time (and avoid having too many MySQL records in memory at one time): //iterate thru 100 Mysql rows at a time and add text to each of these records (using the addtext function) for($i = $MIN; $i < $MAX; $i = $i + 100) { $x = $i; $y = $i + 100; $q = mysql_query('SELECT page_title FROM testdb.test_page WHERE (page_id >='.$x.' AND page_id < '.$y.'AND page_category = 5'); while($row = mysql_fetch_array($q)) { addtext($row['page_title'], "Additional text here"); } echo "A batch of 100 was completed!"; } I keep getting Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\testscript.php on line 47 This script keeps hanging on my Mysql statement mysql_query('SELECT page_title FROM testdb.test_page WHERE (page_id >='.$x.' AND page_id < '.$y.'AND page_category = 5'); Can someone provide advice on a better MYSQL query statement that gets 100 records at a time? i.e. select page_title from the table test_page and get 100 rows at a time and do something with these 100 records? P.S. Everything is working in my MySQL and PHP setup, so I know it's a problem with my sql query. Thanks.
×
×
  • 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.