Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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