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 5 of 5

Thread: If else

  1. #1
    New Coder
    Join Date
    May 2008
    Posts
    94
    Thanks
    11
    Thanked 0 Times in 0 Posts

    If else

    Hey, I'm wondering how can I make it where if the permission field in phpmyadmin, If the permission field is 1 it will say "locked" ?

    For example:

    if >permission>1< echo "Locked"; else echo "Not locked";

    This needs to be taken out of the database from table threads.




    Can someone show me how and what to do?

    Thanks alot.
    Last edited by NightFlyer; 05-20-2008 at 03:23 AM.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    So what exactly have you tried? You'll need a query that gets the permission field.

    Then you can use mysql_fetch_array to get what you need.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    May 2008
    Posts
    94
    Thanks
    11
    Thanked 0 Times in 0 Posts
    How? I have:
    PHP Code:
    $result mysql_query("SELECT * FROM threads WHERE permission='$permission'") or die mysql_error()); ?> 
    But Now what?

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I'm guessing you didn't read the manual for mysql_fetch_array. You need to give us more information. Where is the $permission variable coming from? Why not use 1 in place of the $permission variable. Also are you getting any errors? You should be getting one.

    Another thing this forum is for helping people. Its not here to just give code to people so they can copy and paste it without knowing what the code does.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    May 2008
    Posts
    94
    Thanks
    11
    Thanked 0 Times in 0 Posts
    I know this isn't for giving codes...


  •  

    Posting Permissions

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