28.12.2020

How To Insert Update And Delete Using Php And Mysql

How To Insert Update And Delete Using Php And Mysql 6,1/10 7326 votes
Active8 years, 10 months ago

i need in one query use select, insert, delete and update.

(I need copy data from old table in to new, then delete old, and update another).

Insert and select (copy function I was able to, but now i have problem)

Insert, View, Edit, Delete Record in Database Using PHP is a very simple task given to php newbie to check about their knowledge in php. This add, list, edit and delete record operation uses all basic SQL queries (i.e., insert, select, update, delete). Jul 27, 2015  17 thoughts on “ Insert, View, Edit and Delete Record from Database Using PHP and MySQL ” Pingback: Simple User Registration & Login Script in PHP and MySQL HTML CSS PHP Tutorials dineshramitc.

I have this query:

Thanks

user319854user319854
1,63510 gold badges35 silver badges43 bronze badges

4 Answers

You can't do it all in one query, but you can do it all in one transaction if you are using a transactional store engine (like InnoDB). This might be what you want, but it's hard to tell only using the information you provided in your question.

Ike WalkerIke Walker
51.7k13 gold badges85 silver badges94 bronze badges

MySQL does not support MERGE, so you'll have to do it in two queries:

, provided you have PRIMARY KEY (id) in both tables.

QuassnoiQuassnoi
345k73 gold badges542 silver badges567 bronze badges

In one query i dont think its possible.

You can try writing a Stored Procedure and using Triggers you may achieve that

zodzod
7,98622 gold badges59 silver badges99 bronze badges

/hp-deskjet-f380-driver-windows-10-64-bit.html. You can't combine Select/Update/etc into one query. You will have to write separate queries for each operation you intend to complete.

Chapterpinkfloydx33pinkfloydx33Update
4,3473 gold badges27 silver badges45 bronze badges

How To Insert Update And Delete Using Php And Mysql Web

Not the answer you're looking for? Browse other questions tagged mysql or ask your own question.