Click here to Skip to main content
15,793,923 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
First time user come to order pizza, system work's fine. because no session variable set.
but if same user goes within specific time then he will not be able to put order perfectly because of previous set variables.

some time previous order come if user again come to put second or next order.
there is problem, when we delete an item from order, it does not delete or delete by double clicking or triple because values set by query could not be able to come on first click because of preset values of that variable.

I tried to echo the variables but error generates stating "undefined offset".

here is url for ordering page:

Need your valuable suggestions.

Thanks in advance.
Updated 9-Jul-13 2:17am
Prasad Khandekar 9-Jul-13 7:25am    
Can you share the code please? After user submits the order and you are done with entering the order info in database. Make sure that you are removing respective variables from session. This way next time user visits no prior data will be there in session.

kmax01 9-Jul-13 8:10am    
I have used destructor to destroy the variable. With calling destructor it do functionality prefect for only one piza order. I currently have a lot of code involved in it. But don't know where this variable is from where it is generating error.


I think its better not to use session for orders. Rather you can use database table to store order values. I know it will store a huge unwanted data. But you can set a cron job to remove the orders placed before 7 days. This process is more reliable and I used to use this technique in most of my e-commerce sites.
Share this answer
kmax01 9-Jul-13 8:18am    
Thank you for your valuable suggestion Rony. But if I use database for storing order values, I think it will fill the database, means I think it will slow down the database operations. Am I right?
Rony Sur 10-Jul-13 2:23am    
Probably not.You can set a cron job in your server to remove the orders placed before 7 days. I think you are aware about cron job. If not, just ask your hosting provider to setup one for you. You just need to create a page with a sql query.
The query will be like:
query("DELETE FROM TABLE_NAME WHERE datediff(now(), order_date) > 7");

Hope this will solve your problem
kmax01 11-Jul-13 14:35pm    
thank you for your suggestions. Yes I am aware of it but never used it. I have solved the session issue in the ordering system. Thank you so much for your cooperation and support.
I have solved the issue. Thank you all for your support.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900