AS3 & PHP. how come everytime I call the php file I get the same data?
-
I have this .fla file. i created 2 classes; Grabber and Saver. Everything is working fine except for one thing. everytime I call it (ctrl + Enter or index.html) the same data keeps pulling out. the Grabber class calls getClient.php. getClient.php loads index.php wich has a mysql satement to get info from DB and return it. THE .fla file import com.getFiles.xml.*; import com.getFiles.php.*; import fl.controls.*; var info_txt:TextArea = panel_mc.main_mc.info_txt; var grabber:Grabber = new Grabber(); var saver:Saver = new Saver(); function dataGrabbed(event:Event):void{ info_txt.text = "saving grabbed data"; saver.addEventListener(Event.COMPLETE… fileSaved); saver.save("saver.php", "data.xml", grabber.data); } function fileSaved(event:Event):void{ info_txt.text = grabber.data; } grabber.load("getClient.php", "index.php");//second arq is the addr grabber.addEventListener(Event.COMPLET… dataGrabbed); getClient.php-->> <?php $file = $_POST['fileName']; include("index.php"); //$file goes in here. either way it works echo $content; ?> index.php-->> <?php include("db_conn.php"); $sql = "SELECT * FROM artistBattle"; $result = mysql_query($sql, $conn) or die(mysql_error()); while ($newArray = mysql_fetch_array($result)){ $art1= $newArray['art1']; $vid1= $newArray['vid1']; $art2= $newArray['art2']; $vid2= $newArray['vid2']; $points= $newArray['points']; $battleStat = $newArray['artStat']; $content = "<?xml version=\"1.0\" encoding=\"utf-8\"?> <gallery> <?processing instructions?> <art id=\"$art1\"> <vid1>$vid1</vid1> <points>$points</points> </art> <art id=\"$art2\"> <vid1>$vid2</vid1> <points>$points</points> </art> </gallery>"; } ?>
-
Answer:
If you aren't specifying WHERE criteria in your SQL code, it's going to give you everything. You either have to make your SQL parameter-driven to build a WHERE clause or else add php code to scan each resultset row fetched to decide which ones you want to display. (The former is more typical, but just be sure to do so in such a manner you don't expose yourself to SQL-injection attacks.)
Christopher Robbin at Yahoo! Answers Visit the source
Related Q & A:
- How old do I have to be before I can have a bike license?Best solution by Yahoo! Answers
- What should i do for jobs once I get out the navy?Best solution by Yahoo! Answers
- How often should I call about a job interview?Best solution by workcoachcafe.com
- If I apply for disability will I get it?Best solution by ssa.gov
- Can I be a LVN after I get my EMT?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.