-3

Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource problem

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/skidrowg/public_html/wp-content/plugins/astickypostorderer/croer-transact.php on line 19 errr:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Here is the croer-transact.php code:

<?php
$croer_list = $_POST;
$croer_action = $croer_list[submit];
require_once('croer-functions.php');
if ($croer_action == 'Save and Refresh') {
    // lets clean up the incomming
    $croer_ins_buffer = array(); // to hold what needs to be inserted
    foreach ($croer_list as $croer_pid => $croer_element) {
        if ((!strncmp($croer_pid, 'pid', 3))&&($croer_element!='')) {
            $croer_ins_buffer[substr($croer_pid,3)]=$croer_element;
        }
    }
}
$croer_cat = $croer_list[croer_cat];
if ($croer_ins_buffer) {
    asort($croer_ins_buffer);
}
$croer_old_sorts = croer_get_just_sorted($croer_cat);
while ($row= mysql_fetch_array($croer_old_sorts)) {
    $croer_old_sorts_r[$row[post_id]]=$row[post_rank];
}
if ($croer_old_sorts_r) {
    asort($croer_old_sorts_r);
}
// loop through ellements to insert in new array
// keep offset
$c_new_inserts=array();
$c_removals=array();
$c_ofset=0;
if ($croer_ins_buffer) {
    echo "<!-- >We have insertions< -->";
Community
  • 1
  • 1
Evan Hamlet
  • 161
  • 1
  • 2
  • 8

1 Answers1

0

$croer_old_sorts is set to the value of croer_get_just_sorted($croer_cat) which is apparently a boolean value. Then you pass that value into the mysql_fetch_array function.

mysql_fetch_array takes in a result set that is generated by executing a mysql_query command as follows:

$result = mysql_query("SELECT * FROM table_name");
while($row=mysql_fetch_array($result){
...

FYI mysql library is deprecated in favor of the mysqli library.

ajon
  • 7,868
  • 11
  • 48
  • 86