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

    code help please small problem

    i was given this function but it will not print the words please how do i do it?
    also does the ($result = mysql_query($sql) ) need a (?

    function CheckPrivatePics($userid){

    $sql ="SELECT count( catid )
    FROM `frm_photos`
    WHERE catid =2
    AND userid =".$userid;
    $result = mysql_query($sql)

    if($result > 0){
    return "I have private pictures";
    }else{
    return "I do not have private pictures";
    }
    }

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Change the word return in both instances to the word echo.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Location
    Manchester, UK
    Posts
    533
    Thanks
    4
    Thanked 1 Time in 1 Post
    Quote Originally Posted by wilburforce View Post
    also does the ($result = mysql_query($sql) ) need a (?
    yes. it should be $result = mysql_query($sql);


  •  

    Posting Permissions

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