Web Analytics Made Easy -
StatCounter IF exists in an associative array - CodingForum

Announcement

Collapse
No announcement yet.

IF exists in an associative array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • IF exists in an associative array

    PHP Code:
    //QUERY
    $mycountry[email protected]mysql_query("SELECT c.* ""FROM country AS c ""WHERE c.CountryID=$cid");

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

    //ASSIGNING ASSOC. ARRAY
    $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"];

    //NEW CODE TO ME TO REPLACE LINE ABOVE

     
    $photo $country_front if [EXISTS SELECT AlbumName FROM gallery.albumtb WHERE categoryID == 2 THEN $photo 1];
     endif; 
    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; Aug 23, 2011, 05:13 PM.
Working...
X