RON_ron Posted November 11, 2010 Share Posted November 11, 2010 I'm trying to update several columns. How do I echo messages to confirm each update is successful when each column is updated? $SomeVar = $_POST['finco']; mysql_query("UPDATE adxone SET trace='$address' WHERE username = '".$SomeVar."'"); echo "first message"; $SomeVar = $_POST['finco']; mysql_query("UPDATE adxone SET trace='$address' WHERE username = '".$SomeVar."'"); echo "second message"; Link to comment https://forums.phpfreaks.com/topic/218415-echo-for-each-update/ Share on other sites More sharing options...
ManiacDan Posted November 11, 2010 Share Posted November 11, 2010 Um...like that? What exactly is the problem? Link to comment https://forums.phpfreaks.com/topic/218415-echo-for-each-update/#findComment-1133127 Share on other sites More sharing options...
Jocka Posted November 11, 2010 Share Posted November 11, 2010 $SomeVar = $_POST['finco']; if(mysql_query("UPDATE adxone SET trace='$address' WHERE username = '".$SomeVar."'")){ echo "first message"; } $SomeVar = $_POST['finco']; if(mysql_query("UPDATE adxone SET trace='$address' WHERE username = '".$SomeVar."'")){ echo "second message"; } ? Link to comment https://forums.phpfreaks.com/topic/218415-echo-for-each-update/#findComment-1133130 Share on other sites More sharing options...
RON_ron Posted November 11, 2010 Author Share Posted November 11, 2010 Thanks Jocka. Link to comment https://forums.phpfreaks.com/topic/218415-echo-for-each-update/#findComment-1133163 Share on other sites More sharing options...
RON_ron Posted November 11, 2010 Author Share Posted November 11, 2010 Going a bit further... how can I make a expiry date/time for each update section. E.g. $cutoffTime = 44640; //Cutoff set to one month $drawTime = mktime($20, $5, 0, $12, $25, $2010); //8:05PM on 25/12/2010 if($drawTime-time() < $cutoffTime*60) { $sentOk1 = "Expired!."; echo "sentExpired=" .$sentOk1; } else { $SomeVar = $_POST['finco']; if(mysql_query("UPDATE adxone SET trace='$address' WHERE username = '".$SomeVar."'")){ echo "first message"; } $cutoffTime = 44640; //Cutoff set to one month $drawTime = mktime($20, $5, 0, $12, $25, $2010); //8:05PM on 25/12/2010 if($drawTime-time() < $cutoffTime*60) { $sentOk1 = "Expired!."; echo "sentExpired=" .$sentOk1; } else { $SomeVar = $_POST['finco']; if(mysql_query("UPDATE adxone SET trace='$address' WHERE username = '".$SomeVar."'")){ echo "second message"; } Link to comment https://forums.phpfreaks.com/topic/218415-echo-for-each-update/#findComment-1133167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.