Hi there,
Suppose I have a mysql table like this
Table:multiple
================================
id | date | colA | colB | colC | colD |
================================
Now, I have two cron job setted. cronA.php will have to insert data like this way:
INSERT into MULTIPLE (date, colA, colB) Values(23-09-10,2305,2306)
while a second cron job will execute the cronB.php at later, I want to add data somethin like this:
INSERT into MULTIPLE(colC,colD)Values(2407,208) WHERE date="23-09-10"
i.e I want to add values for colA & ColB at one time and values for colC and colD at later time for the same row (suppose, row id is 10 in both cases)
is it possible? If yes,then please mention the php syntax for this type of job.
Regards.
How to insert data into existing row
Moderator: General Moderators
Re: How to insert data into existing row
You will want to use an UPDATE query
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: How to insert data into existing row
you need update query instead of insert query
Re: How to insert data into existing row
I have a confusion. I think I have to insert at first then the update by second cron job. Because without insert how id will be autoincremented? And if id will not be incremented then how can I update fields, because I have to run query like this:
update colB where id=3 , is not it?
so I have to insert at first like this:
insert date value 1-11-2010
then
update colB where id=2/3 or whatever?
Any alternative way?
update colB where id=3 , is not it?
so I have to insert at first like this:
insert date value 1-11-2010
then
update colB where id=2/3 or whatever?
Any alternative way?