calling php file
Posted: Mon Sep 03, 2007 9:11 pm
Is there any way of calling a php file using mysql trigger?
Thanks
Thanks
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
As far as I know, no. I believe database triggers can only operate on the database.shivam0101 wrote:Is there any way of calling a php file using mysql trigger?
Thanks
Code: Select all
while(1) {
$query_check=mysql_query("SELECT * FROM online ORDER BY member_id DESC");
$num_check=mysql_num_rows($query_check);
$table_current="<table border=1><tr>";
while($fetch=mysql_fetch_array($query_check))
{
$online=$cls_obj->GetMemberPhoto($memberId, $fetch['member_id']);
$table_current.="<td>$online</td>";
}
$table_current.="</tr></table>";
echo '<script type="text/javascript">';
echo "comet.printServerTime('$table_current')";
echo '</script>';
flush();
usleep(10000);
}Every time you refresh, you use up bandwidth. If you want to do it every second, you are welcome to do so. You must put into account that not all users are broadband users, however, and each page request usually takes more than a second.shivam0101 wrote:But, it is not in realtime. We have to wait for 30 sec.
Google uses a lot of languages. But, for what your referring to, they use AJAX.shivam0101 wrote:Which language google uses? Is there any feature in that language which is not available in PHP?
The advantage of using XMLHttp/Ajax is that you only update "part" of a page rather than the whole page. You are obviously restricted to those people who use javascript. Another thing to bear in mind when thinking how often you want the users online to be updated is how long it takes to get the information and what happens to a user when the javascript kicks in to get the information. Users generally hate it when a waiting cursor comes up or link doesn't work immediately when they click it. This can happen if the page is constantly updating information by running javascript.XMLHttp tutorial (who's online example) wrote:...XMLHttp is the precursor to ajax and ajax actually uses XMLHttp to work. Understanding XMLHttp will significantly help you understand and consequently develop applications that are Ajax driven. For more information on Ajax alone, try googling it and you'll come up with a plethora of information...