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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.