MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 28th, 2003, 07:44 PM
dbosz dbosz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 dbosz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
auto update using flash and mysql+php

Hi....


I have a mysql database that store results of game.

My question is how can i display the latest result inserted using flash witout refresh the page.

I think flash can do it....

hope someone have an idea

Reply With Quote
  #2  
Old September 30th, 2003, 12:19 AM
zeflasher zeflasher is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: New Caledonia
Posts: 7 zeflasher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zeflasher
Yes it can.
Just when you're finish your flash game, add the score in the db, then load it

it should look like this.

PHP Code:
 myvar1 'toto';
myvar1 '152';

toupload = new LoadVars();
toupload.sendAndLoad("upload.php?log="+myvar1+"&score"+myvar2this"post"); 
toupload.onLoad(loaded) {
    if(
loaded) {
        if(
this.ok == 'true') {
            
//your insertion is ok*
            
todownload = new LoadVars();
            
todownload.load("loadscore.php");
            
todownload.onLoad(loaded) {
                if(
loaded) {
                    
//code to refresh your board
/*eg you echo in your php file: "&toto=152&tata=100&zeflasher=50&"
so you have 4 keys/values.
Just update your layout with it*/
                
} else {
                    
//the file isn't loaded successfuly
                
}
        } else {
            
//code when inserting the score failed
        
};
    } else {
        
//the file isn't loaded successfuly
    
}



your php script to send var to flash should have echo or print in it like

echo "&myvar1=value1&myvar2=value2"
eg
echo "&toto=152&tata=100&zeflasher=50&"

In your upload.php file do this:
PHP Code:
if($result mysql_query("insert ..."$YourConn)) {
//send to flash that the insert is ok
echo "&ok=true"



hopes it helps



edit: grrr no [ as ] [ /as ] tag here.... so use the php one

Last edited by zeflasher : September 30th, 2003 at 12:29 AM.

Reply With Quote
  #3  
Old September 30th, 2003, 09:32 PM
dbosz dbosz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 dbosz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks zeflasher

i will try your idea..

Reply With Quote
  #4  
Old September 30th, 2003, 11:57 PM
zeflasher zeflasher is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: New Caledonia
Posts: 7 zeflasher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zeflasher
don't say it...

Reply With Quote
  #5  
Old December 20th, 2003, 09:27 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
wondering about something similar

I was wondering can this be achieved at set intervals? I don't know anything except some basic flash stuff. But can it maybe refresh just the flash content every maybe minute or something? Sort of like scrolling news...? thank you...
__________________
hey it's the CHARKING

Reply With Quote
  #6  
Old December 23rd, 2003, 11:25 PM
zeflasher zeflasher is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: New Caledonia
Posts: 7 zeflasher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zeflasher
Yeah for sure you can...
Just put the script in a function and call this function with a setInterval as you said...


Cya and marry christmass

Reply With Quote
  #7  
Old December 25th, 2003, 02:14 AM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
thank you as I said I know little of flash, I'll lok into this setInterval I hope I can learn action script hmm it seems tough.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > auto update using flash and mysql+php


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway