Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Nov 2006
    Thanked 0 Times in 0 Posts

    IF exists in an associative array

    PHP Code:
    $mycountry=@mysql_query("SELECT c.* ""FROM country AS c ""WHERE c.CountryID=$cid");

    if (!
    $mycountry) {
    "<p>Error fetching country details: " .
    mysql_error() . "</p>");

    $mycountry mysql_fetch_array($mycountry);

    //I used to use this but this is very limiting I want to try check if something exists in the db
    $photo $mycountry["photo"];


    $photo $country_front if [EXISTS SELECT AlbumName FROM gallery.albumtb WHERE categoryID == 2 THEN $photo 1];
    Do I have this syntax right? I cannot get it to execute and is this even possible inside of an Assoc. Array?
    Last edited by pcproff; 08-23-2011 at 10:13 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts