473,410 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

transaction Mysql with php

228 100+
i have 2 tables
table1 (key1 int primary key auto_increment, rec1 varchar(255))
table2 (key1 int primary key, rec2 varchar(255))
i need to insert data where table1.key1=table2.key1
rec1='data...' , rec2='another data...'

key1 are an interger value auto_increment

any idea?
Apr 28 '07 #1
2 1190
mwasif
802 Expert 512MB
You can try

UPDATE table1, table2 SET
table1.rec1='data...' ,
table2.rec2='another data...'
WHERE table1.key1=table2.key1

For more information on updating multiple tables visit http://dev.mysql.com/doc/refman/5.0/en/update.html
Apr 28 '07 #2
pbmods
5,821 Expert 4TB
Check out this article on how to use foreign keys:
http://dev.mysql.com/doc/refman/5.0/...eign-keys.html
Apr 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Arnaud | last post by:
Hi, I have a script which inserts some rows in an InnoDB table. I want to be sure that all the rows are inserted, so i use a mysql transaction ("start transaction", insertions, and "commit"). ...
3
by: Frank Natoli | last post by:
After START TRANSACTION but before COMMIT, are intervening SQL transactions visible to other threads or processes? I understand that failing to perform a COMMIT, or explicitly performing a...
1
by: jacob.miles | last post by:
Hello. I'm trying to wrap a function call in a transaction, but when I intentionally throw an exception in the middle of the function it doesn't actually roll back the transaction. The debug...
2
by: jacob.miles | last post by:
I'm trying to connect to a mysql database, with autoCommit and caching off, and I'm trying to create a transaction. Why does this blow up? >>> from sqlobject import * >>> connectionString =...
1
by: Joseph S. | last post by:
Hi all, (1) The "standard method" for handling errors when executing queries to a mysql database, which is shown in most tutorials and books is: mysql($query) or die("select/insert/update/delete...
0
by: davidb999 | last post by:
I'd appreciate any help/suggestions you people working with MySql cluster can offer. I'm hoping MySql Cluster can help us with a high volume need. Our needs are (at max load) 10M Million...
5
by: ashley.ward | last post by:
I am attempting to write a program with VB 2005 Express Edition which accesses an Oracle 9 database and dumps the results of three SELECT queries into a spreadsheet file once every hour. ...
4
by: Shelly | last post by:
I am looking for some advice on the design of a transaction processing sequence. As I xcurrently have it, the sequence is as follows: 1 - Gather all the information from the user other than the...
6
by: Christian Welzel | last post by:
Hi there, currently i'm looking for a way to repeat a rolled back transaction in a nice way. my problem: in my webapp (a browser game) i get a lot of deadlocks in the mysql innodb tables. mysql...
3
by: FeelLikeANut | last post by:
I have the code below. First there is a transaction where I select data. I wrapped it in an explicit transaction because in my real program I run a couple different selects. Nevertheless, the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.