Jump to content

This fetch array Warning is driving me crazy!!


pquery

Recommended Posts

I've been trying to figure out what this page has been barking about for half the afternoon now....

 

I keep getting the same number of fetch array warnings as that are built for my array which is generated, I just don't know if I'm missing a comma or semi or what, because I've inserted it in my DB as a straight SQL query using a number of the values that have been echoed out and it gives me exactly the data that I'm looking for...

 

 

WHILE ( $row = mysql_fetch_array($result2)) {
          $i++;
         $candidates[] = $row['applicationID'];
        
        }

//print_r($candidates);

//misc functions
mysql_select_db("$db2_name")or die("cannot select DB");	

echo " Origional I value = $i <br />";

//foreach ($candidates as &$value) {
WHILE ( $i != 0 ) {
//echo "canidate $i = $candidates[$i] <br />";
$value = $candidates[$i];

//$sql = "SELECT applicationID, firstName, lastName FROM applicants WHERE applicationID = '$value';";
$sql = "SELECT t1.applicationID, `firstName` , `lastName` , `applicantPosition` FROM  `applicants` AS t1 LEFT JOIN applicantposition AS t2 ON ( t1.applicationID = t2.applicationID ) WHERE t1.applicationID = '$value';";


echo "value = $candidates[$i] <br />";

$result = mysql_query($sql);

[b]$row1 = mysql_fetch_array($result);[/b]  // this is where it barks every single time and hence there's no array to for the insert statement later 

 

I've tried my query with $candidates[$i] and then subsuiting $candidates[$i] for $value to see if that made any difference, I've tried a for loop and and while loop countdown to see if that would help and now I'm stuck at the moment.

 

Your help is appreciated as always (I'm hoping it's something simple and stupid I'm overlooking)

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.