Get Data from Mysql instead XML?

johnsonduck

New Member
hey i have this javascript for a bubble up... this script gets InfoID and InfoData tags from an xml file...\[code\]<script type="text/javascript">$(document).ready( function ( ) { // Get the XML data from your file $.get('scores.xml', function( data ) { // Because we've given jQuery the XML datatype, we can jump straight to finding the element. $(data).find('Game').each( function ( ) { // The current object now holds a single "GAME" - find the elements we need var game_id = $(this).find('InfoID').text( ); var game_info = $(this).find('InfoData').text( ); // Create the popup. $('.'+game_id).CreateBubblePopup({ position : 'left', align : 'center', innerHtml: game_info, innerHtmlStyle: { color:'#FFFFFF', 'text align':'center' }, themeName: 'all-black', themePath: 'images/jquerybubblepopup-themes' }); }); // end of each }, 'xml'); // The 'xml' tells jQuery to expect XML back from the request});</script>\[/code\]i need to make this script get data from Database table instead of xml.i have the same InfoID and InfoData rows in a table in my database...i use this php script to get data from db:\[code\]<?php // Connect to database server mysql_connect("localhost", "root", "asnaeb") or die (mysql_error ()); // Select database mysql_select_db("scores") or die(mysql_error()); // SQL query $strSQL = "SELECT * FROM latest"; // Execute the query (the recordset $rs contains the result) $rs = mysql_query($strSQL); // Loop the recordset $rs // Each row will be made into an array ($row) using mysql_fetch_array while($row = mysql_fetch_array($rs)) { // Write the value of the column FirstName (which is now in the array $row)?> <?php echo $row['Header'].""; ?> <?php echo $row['Row'].""; ?> <?php echo $row['Date'].""; ?> <?php echo $row['Time'].""; ?> <?php echo $row['AwayTeam'].""; ?> <?php echo $row['Score'].""; ?> <?php echo $row['HomeTeam'].""; ?> <?php echo $row['Other'].""; ?> <?php echo $row['InfoID'].""; ?> <?php echo $row['InfoData'].""; ?><?php } mysql_close(); ?>\[/code\]any idea how i can do that? so i can remove my xml file and use database :)Thanks in advance.
 
Back
Top