[PHP-DB] HELP With UPDATE Query in mySQL

2003-10-04 Thread Shaun
Hi, I have two columns in my Bookings table of type DATETIME - Booking_Start_Date and Boking_End_Date. How can i update every row so that all of the times for Booking_Start_Date are 09.00 and all of the times for Booking_End_Date are 17.30, without affecting any of the dates? Thanks for your

Re: [PHP-DB] HELP With UPDATE Query in mySQL

2003-10-04 Thread Jeff Shapiro
This should do it: UPDATE Bookings SET Booking_Start_Date = CONCAT(DATE_FORMAT(Booking_Start_Date, '%Y-%m-%d'), '09:00:00'), Booking_End_Date = CONCAT(DATE_FORMAT(Booking_End_Date, '%Y-%m-%d'), '17:30:00'); If you are using version 4.1.1 or newer the DATE_FORMAT function could be replaced

[PHP-DB] Help With Another UPDATE Query Please!

2003-10-04 Thread Shaun
Hi, I am making some alterations to my Database. I have a table called projects and a table called Work_Types. Projects currently contains the name of the work type (Work_Type) but now I want to change this so it contains the Work_Type_ID, is it possible to update Projects with one query? Thanks

Re: [PHP-DB] Help With Another UPDATE Query Please!

2003-10-04 Thread Jeff Shapiro
It all depends on what database server (and version) you are using. I'm not really sure what you are asking, and could use a little more detail about the tables and what are needing to do. On Sat, 4 Oct 2003 13:45:56 +0100, Shaun spoke thusly about [PHP-DB] Help With Another UPDATE Query

Re: [PHP-DB] Help With Another UPDATE Query Please!

2003-10-04 Thread Shaun
I am using mySQL 3.23 Each project has a work type associated with it, currently the Work Type column of the Project table holds the work type name, however i have now added a Work_Type_ID column to the Work_Type table and i would like Projects to hold the Work_Type_ID as opposed to the Work Type