Joepiooo Posted April 8, 2010 Share Posted April 8, 2010 Hi, I made a Highscore system with Flash PHP and MyQSL. Its sending and getting info from Myqsl and is putting it out in Flash. But its shown like this: Here are all the flash scores in our database: name1=Wilfinal1=2000name2=Test final2=1234name3=Zzyzxfinal3=1000name4=Testfinal4=1000name5=Peterfinal5=44name6= asdasdfinal6=25name7=Gekheid final7=20name8=Nick final8=16name9= pietjefinal9=11name10=Truusfinal10=2The data has been written to the table!?> I want to have it in a nice tabel... Is this something I have to do with PHP or Flash? Dont know where to begin to be honest... I allready tried to adjust it in PHP but that aint working very wel.. This is the PHP Code: <?php ////////// FILL IN THIS INFORMATION HERE! //////////// $host = "localhost"; //hostname is usually localhost by default $user = "****"; //insert the name of the user here $pass = "****"; //insert the password here $database = "*****"; //insert name of database wherein table was exported $table = "****"; //insert the name of the table //////////////////////////////////////////////////////// //stores the URLvariables into variables that php can use $one = $_GET['name']; $five = $_GET['final']; // Connects to the database server // outputs an error message is it was unsuccessful $dbcnx = @mysql_connect($host,$user,$pass); if (!$dbcnx) { echo( "<P>Unable to connect to the database server at this time.</P>" ); exit(); } // Selects the specified database if (! @mysql_select_db($database) ) { echo( "Unable to find database" ); exit(); } echo("Here are all the flash scores in our database: "); // Request all the data from the table $result = mysql_query("SELECT * FROM {$table} ORDER BY finalTime DESC"); if (!$result) { echo("<P>Error performing query: mysql_error() </P>"); exit(); } // Display the first three records //for($x=0;$x <6;$x++) //{ // $row = mysql_fetch_array($result); // echo "Name : {$row["name"]}" . // "Final Time : {$row["finalTime"]}"; //} for($i = 1; $i <= 10; $i++) { if($line = mysql_fetch_assoc($result)){ echo "".$i."=".$line["name"]."".$i."=".$line["finalTime"]; } } //this is the command used to write the record into the MySQL database $query="INSERT into {$table} (name,finalTime) VALUES ('{$one}',{$five})"; //executes the command mysql_query($query) or die("Data not written."); echo("The data has been written to the table!"); ?> If someone can help me with this I would be very happy. Thank you Quote Link to comment Share on other sites More sharing options...
Deoctor Posted April 8, 2010 Share Posted April 8, 2010 for($i = 1; $i <= 10; $i++) { if($line = mysql_fetch_assoc($result)) { <table> <tr> <td> echo $line["name"]; </td> <td> echo $line["finalTime"]; </td> </tr> </table> //echo "".$i."=".$line["name"]."".$i."=".$line["finalTime"]; } } try this Quote Link to comment Share on other sites More sharing options...
Joepiooo Posted April 8, 2010 Author Share Posted April 8, 2010 Hi, Tnx for the reply... But I'm getting this error in Flash when I use that: <br /> <b>Parse error</b>: syntax error, unexpected '<' in <b>e:\inetpub\vhosts\justenter.nl\httpdocs\script.php</b> on line <b>54</b><br /> Quote Link to comment Share on other sites More sharing options...
Deoctor Posted April 8, 2010 Share Posted April 8, 2010 oops my mistake echo "<table> <tr> <td>"; echo $line["name"]; echo "</td> <td>"; echo $line["finalTime"]; echo "</td> </tr> </table>"; Quote Link to comment Share on other sites More sharing options...
Joepiooo Posted April 8, 2010 Author Share Posted April 8, 2010 Hi, Thank you... This is better... No error but nothing happened! Its still the same and not in a tabel... I think this time its Flash... Dont think that Flash can show me that table because it cant read PHP. Now I have to figure out what to do next Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.