Reply to Re: real time sql query

Your name:

Reply:


Posted by Jerry Stuckle on 08/25/07 00:36

flashvarss wrote:
> On Aug 25, 2:02 am, Toby A Inkster <usenet200...@tobyinkster.co.uk>
> wrote:
>> flashvarss wrote:
>>> Any one in here knows how to get data from sql database without having
>>> to refresh page?
>> Other than periodically refreshing the page, you have two options:
>>
>> 1. Using AJAX to continuously poll the server;
>> 2. The "multipart/x-mixed-replace" MIME type;
>> 3. Server-sent events <http://labs.opera.com/news/2006/09/01>.
>>
>> A page refresh will offer the widest range of browser support. AJAX will
>> work in any reasonably modern browser with Javascript enabled. Multipart/
>> X-Mixed-Replace is an old Netscape 1.x push technology, which is still
>> supported in Gecko-based browsers, plus Opera and Safari, but not Internet
>> Explorer. Server-sent events, although the neatest solution are only
>> supported by one browser so far -- Opera 9.x -- expect wider browser
>> support in the future.
>>
>> --
>> Toby A Inkster BSc (Hons) ARCS
>> [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
>> [OS: Linux 2.6.12-12mdksmp, up 65 days, 2:30.]
>>
>> TrivialEncoder/0.2
>> http://tobyinkster.co.uk/blog/2007/08/19/trivial-encoder/
>
> So ajax is the best then
> i have a question now
> a simple normal script to call the msg from the database is like that:
>
> <title>Display Messages</title>
> <script type="text/javascript" src="no_click.js"></script> <--//
> refresh script with no click sound when refreshing
> </head>
> <body>
> <?php
> mysql_connect("localhost", "root", "password") or die(mysql_error());
> mysql_select_db("chat") or die(mysql_error());
> $data = mysql_query("SELECT * FROM chat") or die(mysql_error());
> while($info = mysql_fetch_array( $data )) {
> Echo " "said ".$info['words'] . " ";
> }?>
> </body>
> </html>
> Is there an ajax simple example for that?
> Thnaks
>

Try comp.lang.javascript. AJAX is more javascript than it is PHP (in
fact, you can be running PERL, ASP, etc. on the server - and not even
use PHP).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация