calling php file
Moderator: General Moderators
-
shivam0101
- Forum Contributor
- Posts: 197
- Joined: Sat Jun 09, 2007 12:09 am
calling php file
Is there any way of calling a php file using mysql trigger?
Thanks
Thanks
Re: calling php file
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
Why would you need to? Please explain your situation and perhaps better logic could be thought of.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
-
shivam0101
- Forum Contributor
- Posts: 197
- Joined: Sat Jun 09, 2007 12:09 am
That's easily done with a php file with a call to mysql_query().
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
-
shivam0101
- Forum Contributor
- Posts: 197
- Joined: Sat Jun 09, 2007 12:09 am
mysql_query() in a php file and AJAX
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
-
shivam0101
- Forum Contributor
- Posts: 197
- Joined: Sat Jun 09, 2007 12:09 am
I went through this tutorial,
http://www.zeitoun.net/index.php?2007/0 ... t-with-php
example of current time. Modified the code to
feyd, should i have to move this posting to code category?
The problem is, it slows down and also i cant even click other links to navigate to other pages. Is there any better way of implementing this code? Please let me know.
http://www.zeitoun.net/index.php?2007/0 ... t-with-php
example of current time. Modified the code to
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);
}The problem is, it slows down and also i cant even click other links to navigate to other pages. Is there any better way of implementing this code? Please let me know.
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
XMLHttp tutorial (who's online example) could be a useful thing to look at.
-
shivam0101
- Forum Contributor
- Posts: 197
- Joined: Sat Jun 09, 2007 12:09 am
Strictly speaking you can't get realtime, but in practice you can have the javascript code update the page as often as you like (certainly more often than every 30 seconds). XMLHttp is what you need for this and I think you should read the tutorial that CoderGoblin suggested.
/josa
/josa
Last edited by josa on Wed Sep 05, 2007 7:27 am, edited 1 time in total.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
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?
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
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...