Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 587625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:13:55+00:00 2026-05-13T15:13:55+00:00

i m adding an book detail in a page(book_detail.php), when i add book information

  • 0

i m adding an book detail in a page(book_detail.php),
when i add book information ,i m also adding offers and addons via iframe( using lightwindow.js) related with that book and i saved their id;s in 2 session array.
if someone add 2 addons and 3 offers related to that books, i store those addons_is and offer_id in session and when i fill the all detail regarding that book,on the same time i add
addons_is and offer_id in the database in same row.
like

book_id|book_name|book_price|book_addons|book_offers|
 1     | php     | 100      |10,11,     | 17,18,19

where 10,11 from table_addon where that addon detail is saved
and 17,18,19 is from table_offers where offer details are saved

now my question is:
if someone add 2 offers and 3 addons with their detail, and does not go to submit that page( means he does not add details of that book) and go back, then how do i delete that addons and offers from both of tables.means i want to reset session array as well as the entry from both of table , if someone comes again to add new book detail.

i can not reset session when use comes first time , because on adding addons via iframe , page refresh automatically, so it is not possible to reset session on page load

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:13:55+00:00Added an answer on May 13, 2026 at 3:13 pm

    In terms of how to delete the database records, look into using transactions with MySQL. The idea is that you:

    • Start a transaction
    • Execute a series of DML statements (INSERT,UPDATE,DELETE…SELECT is also allowed)
    • Commit the transaction (make all changes permanent)

    At any point after starting the transaction, you can use ROLLBACK to undo the changes that were made since the transaction was started. However, once the entire transaction is committed (using COMMIT) it is final.


    In terms of deleting the session data in PHP, you can just unset it:

    unset($_SESSION[varname])
    

    HTH,

    -aj

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm able to add contact to address book now after adding the contact whil
Using CakePHP 1.3 I understand the example at http://book.cakephp.org/complete/1143/Data-Validation#Adding-your-own-Validation-Methods-1181 on how to add my
I have a media program. i am adding CD,dvd,book info. I managed to get
I'm currently rebuilding an existing PHP application using Java. I therefore have an existing
Can anyone please help me on adding new contacts in address book and apply
I'm adding a contact to the address book, so far it just contains the
Using the Smith-Waterman algorithm for a book homework assignment, I made up a table
I'm trying to learn project automation and I'm using the book Pragmatic Project Automation
I'm adding contact details to the address book from my app. And I have
I am adding Multiple addresses to my address book, but when I try to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.