Cypher Palace (a continuing discussion of server side Flashness)

As the title and stickiness of the thread imply… this is my attempt to start a running dialogue with people like h88, lostinbeta, supra, Eyez, pom, etc., (if I missed some of you sorry… I’ll try to get you next time around.) to pick their brains clean. The end result obviously is to come up with the best, well documented methods for sending our Flash data to servers for manipulation, storage and or retrieval.

Now on the three sites that I’m currently working on, I’m using XML as a data structure inside my Flash, PHP and MySql on the serverside. It’s a pretty common setup.
My problem right now lies in changing information from DB format to XML format. PHP is good for this sort of thing, however… I’m not all that sure that I can do what I was thinking I could do.
XML uses the XML objects in Flash, to load, for properties, ect.
loadVaribles(); is used to initialize the process of getting data from the server’s php scripts.

So I’m assuming at this point that I have to take the data into Flash as arrays, and then make the XML object in Flash.

h88 is working with me a bit, but I’m a dense learner on serverside so it’s slow going.

I’d like to know what methods other people are using… how slow or fast they think their setup is, and anything else that pops to mind. I’ll probebly post a couple of php and a/s scripts in here for peering at, or asking questions about…

Hmm, I wish I could help you out in this one david, but I don’t know how to use Databases :frowning:

I use the XML object when dealing with XML and loadVars for the others.

My server just got a new mySQL database hooked up… my friend offered me to use it as I wanted… so I should probably think about learning it :-\

Ok David, what is it you wanna do here, a collection of woprking scripts/ methods etc, or discus stuff…open to all/ any…

Pretty much an open discussion of the best methods, and how they work. But I certainly have it in mind to ask some specific questions when they come up.

I seem to be really poor at debugging php. :stuck_out_tongue:

ok… here’s an example of a problem I’m having

<?php
$server="*******";
$name="*******";
$passWord="*******";
$tableName="********";
$dataBase="********";
$hookUp=mysql_connect($server, $name, $passWord) or die ("Error loading requested data");
mysql_select_db($dataBase,$hookUp);
$result = mysql_query("SELECT * FROM $tableName",$hookUp);
$numrows=mysql_num_rows($result);
for($i=0;$i<$numrows;$i++){
	$date=(mysql_result($result,$i,"date"));
	$dateArray["$i"]="$date";
	echo $dateArray["$i"];
	$entry=(mysql_result($result,i,"entry"));
	$entryArray["$i"]="$entry";
	echo $entryArray["$i"];
}
?>

Now… when I look at the output… I get 3 sets of echos… but they are all the same date and entry. Why would that be??

Now really I’m just playing around here to see what I can write up… but my ultimate goal is to create a multilevel array which is then sent to Flash. So if anyone has an idea of how to do that, I’d appreciate the help.

Your for loop isn’t requesting diffrent data. Its getting the same row everytime

Do this instead. Once you do your query and get the data, make it a while loop


while($row = mysql_fetch_row($result)){
    // Stuff here
}

I will try that… though I’m not sure why the data is the same every time I request it in the for loop. I’m incrimenting i, and using i as the numbered denoter for the data. It seems to me like that should work fine.

I’ll reread through my code again… maybe I missed something obvious.