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.
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.
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).
Thank you sir! Are a lifesaveranother hopefully quick question on the ticket view when they reply after submittting if they refresh it keeps adding the reply into the DB
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).
hey wondering if you can help with something else to right now i just have the code of
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!PHP Code:
echo "<div class=\"panel-body\">" . $row['department'] . "</div>";
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.
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
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.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']];
Freelance Web Developer
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 everythingShouldn'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!