NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page Realtime php/mysql gatherer (hmm...)

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
6 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 04-02-2005, 07:12 AM THREAD STARTER               #1 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



Realtime php/mysql gatherer (hmm...)


I need a way to "refresh" php in realtime. either way would be:

1. When it detects a new field in a mysql table based on a mysql query it refreshes the page

2. It just loads up new information when it can

I thought about using a "while" thing for this, but I couldn't think of a good way to do it. Any help would be excellent!

Thanks in advance

Tom
PoorDoggie is offline  
Old 04-02-2005, 08:36 AM   #2 (permalink)
NamePros Regular
Join Date: Feb 2004
Location: Student @ UConn
Posts: 411
gamex has a spectacular aura aboutgamex has a spectacular aura about
 



Can you explain a little more the whole situation and what you are trying to do? I mean, is this something that you can use cron jobs for?
__________________
Joe
gamex is offline  
Old 04-02-2005, 09:42 AM THREAD STARTER               #3 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



no. I am trying to make like a chat script for php where it will automatically update the page. Like this:

1. User writes message + submits
2. Message gets stored in DB
3. On user's friend's side the php script is constantly checking for new messages, but without messy window refreshes
4. When a new message is found, the script writes it up on the screen (or refreshes - but only when a new message is found)

and vice versa!

Thanks
Tom
PoorDoggie is offline  
Old 04-02-2005, 12:41 PM   #4 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
that cant be done not with php anyway.

php is a server side script what you need to do is use a javascript refresh or something like that to refresh the page with the chat.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 04-02-2005, 01:14 PM   #5 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
you would nee to keep the page rehfresh every so often
adam_uk is offline  
Old 04-02-2005, 01:17 PM THREAD STARTER               #6 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 




Originally Posted by adam_uk
you would nee to keep the page rehfresh every so often
thats what I didn't want really.

Is there a way I can get javascript to "send" a php function to the server, and have it return something? (i know I am probably talking dribble now! lol)

so apart from refreshing the page, there is no way to do this?

Is there any way to refresh the page neatly and quickly?
PoorDoggie is offline  
Old 04-02-2005, 01:22 PM   #7 (permalink)
Account Suspended
 
axilant's Avatar
Join Date: May 2004
Location: /etc/passwd
Posts: 2,178
axilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to behold
 

Member of the Month
July 2005

this can be done via flash. nothing is impossible.
axilant is offline  
Old 04-02-2005, 01:28 PM   #8 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
Originally Posted by PoorDoggie
thats what I didn't want really.
????: NamePros.com http://www.namepros.com/code/79661-realtime-php-mysql-gatherer-hmm.html

Is there a way I can get javascript to "send" a php function to the server, and have it return something? (i know I am probably talking dribble now! lol)

so apart from refreshing the page, there is no way to do this?

Is there any way to refresh the page neatly and quickly?
i know its possible (i havent done though a freind has) to build a script with javascript that can call data from a page

so you could have pagea.php inside this youd have your javascript function insdie a timer which refreshed every 30 seconds. this would call pageb.php then javascript would present the information out in a page which means you wouldnt need to refresh pagea.php
adam_uk is offline  
Old 04-02-2005, 02:03 PM THREAD STARTER               #9 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



Originally Posted by adam_uk
i know its possible (i havent done though a freind has) to build a script with javascript that can call data from a page

so you could have pagea.php inside this youd have your javascript function insdie a timer which refreshed every 30 seconds. this would call pageb.php then javascript would present the information out in a page which means you wouldnt need to refresh pagea.php
any idea what this would be called? or how to search for tutorials on the net?

Thanks a lot!
????: NamePros.com http://www.namepros.com/showthread.php?t=79661
Tom
PoorDoggie is offline  
Old 04-02-2005, 02:23 PM   #10 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
im not sure what to search for but here is an example

http://www.aspplayground.net/forum/forumid_2/tt.htm#

then click one the plus signs

im guessing the bit you need is there it lodas the data then then slign than in a time function.

i just had a quick root through there source and turnt this up

http://www.aspplayground.net//forum/js/treeRow.js

adam_uk is offline  
Old 04-02-2005, 02:37 PM THREAD STARTER               #11 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



Originally Posted by adam_uk
i just had a quick root through there source and turnt this up

http://www.aspplayground.net//forum/js/treeRow.js
????: NamePros.com http://www.namepros.com/showthread.php?t=79661

er... right.

I think, although you are very kind, I will stick with the reloading page. Or I will figure something out which is slightly easier. What you gave me, really didn't help. Infact I almost s**t myself!

Acctually thinking about it - I could have an iframe and then just reload the iframe. Or do some fancy javascript whatnot to just re-write whats in it!

Thanks for all the help!

Another question, to stimulate your tired braincells (aww... I don't mean it... seriouslly! ):
- Is there anyway of getting info out of a mysql database with javascript? I suppose if I can, then I can just reload the content in an iframe every 5 seconds or something using "iframename.document.write" javascript function. I don't know much about javascript... that is my only problem!

Thanks a lot, for all the replys I have already had, and all the ones I hope to recieve!

Tom
PoorDoggie is offline  
Old 04-03-2005, 10:45 AM   #12 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Originally Posted by PoorDoggie
- Is there anyway of getting info out of a mysql database with javascript? I suppose if I can, then I can just reload the content in an iframe every 5 seconds or something using "iframename.document.write" javascript function. I don't know much about javascript... that is my only problem!
no you will need to use the javascript to call an external script such as a php script or any other server side script. in the iframe just point it to the php script you create to pull the chat from the db then use javascript to do the refreshing every 30 seconds or whatever.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 04-03-2005, 12:36 PM THREAD STARTER               #13 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



thanks filth... I suppose that is the way it will have to happen!
PoorDoggie is offline  
Old 04-07-2005, 03:24 PM   #14 (permalink)
Account Suspended
 
axilant's Avatar
Join Date: May 2004
Location: /etc/passwd
Posts: 2,178
axilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to behold
 

Member of the Month
July 2005

if you ever seen http://achaea.com look at the java applet, i have made a clone of this game via php/mysql/flash and it loads just as fast, if not faster. Flash is the way to make something this...
axilant is offline  
Old 04-07-2005, 03:51 PM THREAD STARTER               #15 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



nice site! that looks really good, I bet yours is better though. You can do a hell of a lot more with flash. That my only problem though, is the flash. I can't do it. I probably could if I put my mind to it, but I don't know it yet.

Can anyone point me in the direction of any good tutorials?

Thanks
Tom
PoorDoggie is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed with personal project. PHP/MySql programming and layouts! QBert Website Development 3 11-09-2004 10:52 AM
Experienced php/mysql coder [FOR HIRE] Low prices! matrixnet For Sale / Advertising Board 0 04-12-2004 12:09 PM

 
All times are GMT -7. The time now is 07:44 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger