RE: How-to pass informational mysql messages to the browser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I like to use a js alert box to notify the users

/*************************************************************************
              alert box popup confimation message function
*************************************************************************/
function confirm($msg)
{
 echo "<script langauge=\"javascript\">alert(\"".$msg."\");</script>";
}//end function


Then in the code I create the message as needed. In your case, you can validate the query worked and then do :


$msg = "Tape deleted";   //simple to even add the tape number in as well
confirm($msg);


bastien

From: "Mike Millner" <mike@xxxxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Subject:  How-to pass informational mysql messages to the browser
Date: Thu, 24 Feb 2005 15:07:00 -0700

Hello everyone,

My PHP/mysql pages are working perfectly, the problem is users don't know if what they are doing is working.

I have a system that adds and deletes tape id's from mysql via a PHP front end.

I would like to pass the same success/failure messages that I would get if I performed the add/delete directly within mysql.

For example, If I delete a tape from the db within mysql, after I hit enter I get the following message:


mysql> delete from tape_tracking_test where media_id like 'TR44'; Query OK, 1 row affected (0.01 sec)


I would like to display this message to the browser:

Query OK, 1 row affected (0.01 sec)


Any help would be appreciated,

Thanks,
Mike

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux