mysql_query returning empty result after DELETE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I did a "DELETE FROM picture" where "picture" is a table in my database.

Afterward, this piece of code does not generate an error
----------------------------------------------
try
      {
      $query = "SELECT * FROM picture p " .
                          "WHERE p.pictureFile='" . $pictureFile . "'";
      $thisRow =
              mysql_query($query, $pictures_connection);
      }
      catch(Exception $e)
             {
             echo 'caught exception: ',  $e->getMessage()."\n";
             $result = False;
             }
----------------------------------------------
and testing $thisRow
----------------------------------------------
if(!$thisRow)
      {
      echo "picture '" . $pictureFile . "' does not exist in the
database.\n";
       }
else
      {
      echo "picture '" . $pictureFile . "' exists in the database.\n";
      $picture_table = array();
      $picture_row = mysql_fetch_array($thisRow);
      do        /* capture row's picture data */
           {
           $picture_table[$picture_row["pictureHandle"]] = array(
               "pictureName" => $picture_row["pictureName"],
               "pictureFile" => $picture_row["pictureFile"],
               "pictureMapFile" => $picture_row["pictureMapFile"],
               "pictureDescription" => $picture_row["pictureDescription"],
               "pictureDescriptionFile" =>
$picture_row["pictureDescriptionFile"],
               "pictureDateTime" => $picture_row["pictureDateTime"],
               "pictureOrientation" => $picture_row["pictureOrientation"],
               "pictureStamp" => $picture_row["pictureStamp"]
                                                                            
                  )     /* add this row to the table */;
       } while(($picture_row = mysql_fetch_array($thisRow)));
      print_r($picture_table) . "\n";
----------------------------------------------------------------
results in an empty array being printed ... implying that the query
was successful?

Help, please.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux