corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Friday Night MySQL Party


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Friday Night MySQL Party
ed
Member

Registered: 10th Sep 03
User status: Offline
12th Oct 12 at 21:05   View User's Profile U2U Member Reply With Quote

Right, got a simple query which selects the first five records from a database like so:

SELECT Public_ID,User_ID,Full_URL,Description FROM jbs_images WHERE Accepted=1 && YT_ID='wait' ORDER BY Last_Update LIMIT 0,5

Is it possible to update a value while doing a select? I'd like to set YT_ID to 'queued' somehow, could do a second query I suppose.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
12th Oct 12 at 21:07   View Garage View User's Profile U2U Member Reply With Quote

No, update and select are separate.

Although the where clause will be the same to select the same records you want to affect.
ed
Member

Registered: 10th Sep 03
User status: Offline
12th Oct 12 at 21:08   View User's Profile U2U Member Reply With Quote

Two queries it is then - thanks
Baskey
Member

Registered: 31st May 06
User status: Offline
12th Oct 12 at 21:52   View User's Profile U2U Member Reply With Quote

You wouldn't be updating it but you could use a case statement to display 'queued' instead of wait in the results

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Devon drunkenfool South West 7 612
21st Jul 03 at 22:56
by drunkenfool
 
hows your weekend been? corsa_godfather Scotland 9 506
28th Feb 05 at 16:23
by deanmcreynolds26
 
Server Help Jodi_the_g Geek Day 7 1458
19th Jan 06 at 15:18
by Jodi_the_g
 
My SQL-Nearly there! Tom J Geek Day 31 3189
25th Dec 06 at 23:32
by Ian
 
Weekend Match Thread - Sponsored by The hardworking armchairs of CS JonnyJ Sports Day 581 8553
24th Jan 12 at 22:27
by Nath
 

Corsa Sport » Message Board » Off Day » Geek Day » Friday Night MySQL Party 29 database queries in 0.0110431 seconds