Running a PHP script at a specific place in the code

Bougsogslig

New Member
Ok, So I have a external php script that get data from a DB and displays it in a table. I want to run it in a specific div in my html so the data gets echoed out in the right place?Any ideas how to do that?Html div\[code\]<div id="statsContent"><?php include('updatestats.php'); ?></div>\[/code\]Heres the PHP code.\[code\]<?php//Start sessionsession_start();//Make sure user is logged inrequire_once('auth.php');//Include database connection detailsrequire_once('config.php');//Connect to DB$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);if(!$link) {die('Failed to connect to server: ' . mysql_error());}//Select database$db = mysql_select_db(DB_DATABASE);if(!$db) {die("Unable to select database");}//Create Querys$query = "SELECT * FROM stats WHERE member_id='" . $_SESSION['SESS_MEMBER_ID'] . "' "; $result = mysql_query($query);//Gather the whole row into an arraywhile($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $money = $row['money']; $bank_money = $row['bank_money']; $ap = $row['ap']; $exp = $row['exp']; } //Now create a table to display the data to the userecho "<table> <tr> <td>Money $$money</td> <td>Action Points $ap</td> <td>Experience $exp</td></tr>";?>\[/code\]
 
Back
Top