Using isset to return to same page with updated info

I have a page that I want some variables to stay the same and others to reset on an add button push. I think I can do it with the isset command but I am not sure how. Here is how my page is working:

//Get the order number - auto incremented so only used as a reference
$result = mysql_query("SELECT COUNT(onum) as number FROM orders", $con);
$ordernumquery = mysql_fetch_row($result); 
$ordernumquery = $ordernumquery[0]; // mysql_fetch_row returns an array. we only want the Name so we just set it excluseively.
$ordernumquery +=1;

Open in new window


I want to keep the $ordernumquery the same so when they add an item I can reuse it to query the database for the items already added.

The other variables I would also like the keep the same are the customer, Check out date and return date. When they are completed I want to put a submit button at the bottom that will add the last record and go back to the menu.

Here is what my page looks like. I have hard coded my ordernumquery so you can see the item results.
 Screen print
LVL 3
teedo757Asked:
Who is Participating?
 
Mohamed AbowardaSoftware EngineerCommented:
Store $ordernumquery in sessions variable:

http://www.php.net/manual/en/book.session.php
0
 
InventoryMarketingCommented:
Hello,

Are these variables being sent via $_POST or $_REQUEST ?  what action triggers the page refresh to cause the variables to be checked?

Hope this helps
0
 
teedo757Author Commented:
They are being sent via $post.  The entire page is under the same form. Right now the add button submits the form but is not currently tied to a page to upload to the database.

baseurl/createOrder.php?Customers=1+&mout=04+&dout=19+&yout=2011+&min=04+&din=22+&yin=2011+&itemcatsearch=audio&itemnum=4&itemqty=1&Add=Add

Hope that helps
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
teedo757Author Commented:
Even with the link I was not able to get this to work correctly. An example with my specific problem in mind may have helped
0
 
Mohamed AbowardaSoftware EngineerCommented:
> I want to keep the $ordernumquery the same so when they add an item I can reuse it to query the database for the items already added.

Sessions will do EXACTLY what you want, why did you assigned grade C?
0
 
teedo757Author Commented:
Sorry I must just grade a little harder then most. I understand this is free advice and I do appreciate all the comments. I was just expecting some explanation on how to use a session. I try to search for solutions to my problems before posting and had run across several sites using sessions and using issset I was having a problem implementing it into my project.

I should have and will in the future give more time before closing a question. I had just found another solution to my problem and did not want to leave an unneeded question open. Thanks for the comments.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.