Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19
  1. #11
    Senior Member
    Join Date
    Nov 2013
    Posts
    146
    Member #
    37737
    Liked
    15 times
    ok i added break; to both and now it's fine

    I'd like to know, how do I make it show results form the database upside down so the newest are at the top?
    Thanks.
    Last edited by noodles415; Sep 04th, 2014 at 08:50 PM.

  2.  

  3. #12
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,865
    Member #
    5580
    Liked
    731 times
    Let's say I'm doing a query for open status orders and I want the newest one first. Pretend I have a column name called 'id' which is automatically incremented when a row is inserted. So the newest member has the highest id number.

    SELECT * FROM members WHERE status='open' ORDER BY id DESC

    That would sort the query result in descending order (the newst id first).


  4. #13
    Senior Member
    Join Date
    Nov 2013
    Posts
    146
    Member #
    37737
    Liked
    15 times
    Thank you sir! Are a lifesaver another hopefully quick question on the ticket view when they reply after submittting if they refresh it keeps adding the reply into the DB

  5. #14
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,865
    Member #
    5580
    Liked
    731 times
    Once they reply, set a new PHP SESSION variable, perhaps call it $_SESSION['reply']

    Always check to see if that session variable is set before you let them reply. If it's set, that means they have already replied, so don't process it.
    If it's not set, let them reply and then set the session variable.

    They are then locked out of replying until they close their browser (at which time the session gets killed).


  6. #15
    Senior Member
    Join Date
    Nov 2013
    Posts
    146
    Member #
    37737
    Liked
    15 times
    hey wondering if you can help with something else to right now i just have the code of
    PHP Code:
    echo "<div class=\"panel-body\">" $row['department'] . "</div>"
    but that's just a number, i have the departments stored in another table called departments, how would i get it to put the name. thanks!

  7. #16
    Senior Member
    Join Date
    Nov 2013
    Posts
    146
    Member #
    37737
    Liked
    15 times
    Quote Originally Posted by mlseim View Post
    Once they reply, set a new PHP SESSION variable, perhaps call it $_SESSION['reply']

    Always check to see if that session variable is set before you let them reply. If it's set, that means they have already replied, so don't process it.
    If it's not set, let them reply and then set the session variable.

    They are then locked out of replying until they close their browser (at which time the session gets killed).

    I don't mind the customer adding additional replies. The problem is, let's say they submit a reply then periodically refresh the page to see if an admin has replied. Well, each time they do this they get the "confirm form resubmission" or whatever, varies by browser, but then it adds their last reply again.

  8. #17
    Member
    Join Date
    Nov 2012
    Location
    Tampa. FL
    Posts
    59
    Member #
    33844
    Liked
    21 times
    If you set your status in your database to a tinyint and set them as 0-4. You could then set up an array of status messages with your button HTML
    PHP Code:
    $stati = array(    '<span class="label label-default">Closed</span>',    '<span class="label label-default">Open</span>',    '<span class="label label-default">Answered</span>',    '<span class="label label-default">In progress</span>',    '<span class="label label-default">Escalated for management review</span>');
    echo 
    $stati[$row['status']]; 
    In the last line, you're just echoing the array item that matches the index of your status. Remember that array indexes start at 0.
    Freelance Web Developer

  9. #18
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,865
    Member #
    5580
    Liked
    731 times
    I can't figure out a good way to explain this method ...

    See this:
    Post/Redirect/Get - Wikipedia, the free encyclopedia

    There are other methods too.

    We might have to know more about your scripts ... like is the form submitting to 'itself'?
    Last edited by mlseim; Sep 07th, 2014 at 11:12 AM.


  10. #19
    Senior Member
    Join Date
    Nov 2013
    Posts
    146
    Member #
    37737
    Liked
    15 times
    Quote Originally Posted by mlseim View Post
    I can't figure out a good way to explain this method ...

    See this:
    Post/Redirect/Get - Wikipedia, the free encyclopedia

    There are other methods too.

    We might have to know more about your scripts ... like is the form submitting to 'itself'?
    Back after a break from this and unfortunately I'm now having to re-learn everything Shouldn't have left this alone for like a month. I'm not going to worry too much about this bug because I got lost in that Wikipedia article. It makes sense until it doesn't.

    Now that I'm actively working on this again I'm sure I'll come up with more questions. Thank you for your patience!


Page 2 of 2 FirstFirst 1 2

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:20 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com