Possible PHP or my SQL print statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wilburforce
    New Member
    • Oct 2006
    • 2

    #1

    Possible PHP or my SQL print statement

    Please excuse my ignorance
    I’m new to PHP and MySQL, I’m trying to print a message if member have private image.

    I have a table row called "catid" that determins if the image is public or private.

    0 = public
    1 = private


    I need to make either a SQL/php statment for the member to determine if they have a catid of 1 or 0 (or both).


    I hope i have put this in the correct place.

    Thank you
    Paul
  • wilburforce
    New Member
    • Oct 2006
    • 2

    #2
    I have had a go and Im miles away i know, any idea

    <?php


    $sql = ("SELECT int
    WHERE catid = 1");

    $result = mysql_query ($sql, $conn);

    if (=$result) {
    echo " private Images";
    }
    ?>

    Comment

    • miller
      Recognized Expert Top Contributor
      • Oct 2006
      • 1086

      #3
      Originally posted by wilburforce

      $sql = ("SELECT int
      WHERE catid = 1");
      Two things
      1) You're not specifying a table "FROM" which to "SELECT"
      2) You're attempting to access a column named "int" which should be a reserved keyword in SQL. Or even if it's not, you should name your column something else.

      Comment

      Working...