Go Back   SitePoint Forums > Forum Index > Program Your Site > PHP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Nov 22, 2009, 07:38   #6
billy_111
SitePoint Guru
 
billy_111's Avatar
 
Join Date: Jul 2009
Posts: 860
Hey Shrapnel,

I dont think i have explained properly.

And yes i will be using mysql escape string when i have finished testing..

I changed the SQL to this:-

PHP Code:

        $past_insert = "UPDATE tbl_job_reviews SET company = '".$_POST['txt_working']."' WHERE member_id = '".$_SESSION['MEM_ID']."' AND date_added = (select max(date_added) from tbl_job_reviews WHERE member_id = '".$_SESSION['MEM_ID']."')"; 

So i want to update the tbl_job_reviews table. But i want to update ONLY the latest record with the mem_id of lets say 18. There are multiple tuples in the database where mem_id 18 exists so i only need to ever update the last one..

Therefore i thought i would need to use the date_added field in my database. Can i do this?

Billy
billy_111 is offline   Reply With Quote
 

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 02:29.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved