Jump to content

update multiple entries in 1 query possible?


amites

Recommended Posts

I suppose it would have helped if I posted some code with my question,

 

	$query = "UPDATE bil_msg_sent AS s"
	. "\n JOIN bil_msg_look AS l ON (l.locid = s.locid)"
	. "\n JOIN bil_users AS u ON (u.id = s.userid)"
	. "\n JOIN bil_location AS loc ON (l.locid = loc.id)"
	. "\n SET s.last_read = now()"
	. "\n WHERE s.msg_date BETWEEN l.look_date - INTERVAL 1 hour AND l.look_date + INTERVAL 1 hour"
	. "\n AND s.active = 1"
	. "\n AND l.active = 1"

 

I'd also like to update field "s.read" to equal "s.read + 1"

though I'm not certain how to do that one,

 

any suggestions would be greatly appreciated

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.