1

Just stuck up, how to use multiple query in single form to execute different query.

eg:

enter image description here Like in image, Table 1 has records.

what i am doing is:

extract first 3 record from table 1 and show in a form (frontend) and when this process is gone..

i need at same time , this happens without refresh and without user data or any frontend disturbance.

Once this data view to user:

i need:

same time, those 3 records get copy to table 2 from table 1. like Roll_no and Name.

Then, remove those 3 records from table 1.

i am doing this to prevent duplicate data and something.

so any code will be helpful.

8
  • You need to use SQL procedures (MYSQL/PGSQL/SQL server) Commented Apr 12, 2013 at 8:14
  • 2
    Your question is very unclear. Are you asking how to execute various statements in a single transaction ? Commented Apr 12, 2013 at 8:14
  • 1
    Focus on question and rephrase it. And cut your image. Commented Apr 12, 2013 at 8:15
  • 1
    Trasactional SQL will help. Commented Apr 12, 2013 at 8:17
  • 1
    @devilcrab you don't need to speak perfect English to get answers on stackoverflow I truly am not sure I understand what you are trying to do. I just hope I got it right in my answer Commented Apr 12, 2013 at 8:24

1 Answer 1

2

Your question is quite unclear, but it seems you are concerned about data integrity performing multiple queries. What you need is to use transaction to group a set of commands toghether. This way either all commands will succeed or your database will not be affected by any of them.

Sign up to request clarification or add additional context in comments.

4 Comments

@devilcrab that would depend on the database you use and the way you use it. I strongly recommend you research the topic as performing transactions is a very important part of databases.
hmm i am using MySQL, and PHP. and all 3 table are in same database.
Then I guess this is the link you need. I don't think I can explain it in few sentences and as the matter is well documented, I believe it is better for you to read from the source.
Thanks a lot ! now i will get over it :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.