Jump to content

echo for each update?


RON_ron

Recommended Posts

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

$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";
}

?

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";
}

Archived

This topic is now archived and is closed to further replies.

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