Web Analytics Made Easy -
StatCounter SQL statement help please to print a statement - CodingForum

Announcement

Collapse
No announcement yet.

SQL statement help please to print a statement

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

  • SQL statement help please to print a statement

    What i have to do is use the table row called "catid" to determin if the image is public or private.

    0 = public
    1 = private

    and then do a SQL statment for the member that determins if they have a catid of 1 or 0 (or both).


    something like this bloody hopeless i know, but i know nothing about sql


    select where row (catid)=0;
    if catid==0 then print ""
    else
    print "private Images"

    been looking on the IBM site for SQL how do you all the database?

  • #2
    PHP Code:
    $sql mysql_query("SELECT * FROM `table` WHERE `id` = '0'") or die(mysql_error());
    while(
    $row mysql_fetch_array($sql)){
    if(
    $row[catid] == 0){

    }elseif(
    $row[catid] == 1){

    }

    Comment

    Working...
    X