Web Analytics Made Easy -
StatCounter Is it php or SQL im not sure what to do - CodingForum

Announcement

Collapse
No announcement yet.

Is it php or SQL im not sure what to do

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

  • Is it php or SQL im not sure what to do

    I am trying to do this in PHP

    I would like to print a message if member have private images.
    I have a table row called "catid" this determins if the image is public or private.

    0 = public
    1 = private

    not sure if i write php or sql statement?

    select from table catid

    if value=1;
    print"private image";

  • #2
    If you pull 'catid' from the database and assign it as $catid, here is one way you could usePHP to assign the message:

    Code:
    if ($catid == 1) { $message = "private image"; }
    else { $message = "public image"; }
    echo $message;

    Comment


    • #3
      please do not cross post in more than one forum. if you are having trouble getting your question answered in one forum ask for it to be moved into the other forum, that way all the answers will be gathered in one place.

      also please use decent thread titles that will give users an idea of what the thread is about.

      Comment

      Working...
      X