View Single Post
Old 01-14-2008, 08:30 PM   #1 (permalink)
birdbrain24
Junior Member
 
Join Date: 01-14-08
Posts: 10
iTrader: 0 / 0%
Latest Blog:
None

birdbrain24 is liked by many
Question Add AJAX to my PHP MySQL page?

I was wondering how to make my PHP MySQL page queries refresh when they change without the page refreshing! I think that AJAX is the only way i could do that so could someone could me do it because i don't know any AJAX and i don't want to try and learn another language!

Here's the script
PHP Code:
<html>
<
head>
<
title>Site</title>
</
head>
<
body>
<?
php
session_start
();
include(
"functions.php"); 
connect();
sessioncheck();
$username=$_SESSION['username'];

$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));
$info=mysql_fetch_object(mysql_query("SELECT * FROM user_info WHERE username='$username'"));

$carselected=$info->carselected;
$carname=mysql_query("SELECT * FROM cars WHERE id='$carselected' AND username='$username' LIMIT 1");
$cars=mysql_fetch_object($carname);

?>
<div align="center">
<table width="295" height="93" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" width="72"><strong>Username :</strong></td>
<td align="left" width="223"><?php echo "$fetch->username"?></td>
</tr>
<tr>
<td align="right"><strong>Rank :</strong></td>
<td align="left"><?php echo "$fetch->rank"?></td>
</tr>
<tr>
<td align="right"><strong>Cash :</strong></td>
<td align="left"><?php echo "$".makecomma($fetch->cash).""?></td>
</tr>
<tr>
<td align="right"><strong>Vehicle :</strong></td>
<td align="left">  <?php if($carselected == 0){ echo "None"; } else { if($carselected != 0){ echo $cars->name; }}?></td>
</tr>
<tr>
<td align="right"><strong>Location :</strong></td>
<td align="left"><?php echo "$fetch->location" ?></td>
</tr>
<tr>
<td align="right"><strong>Reputation :</strong></td>
<td align="left"><?php echo "".makecomma($fetch->reputation).""?></td>
</tr>
<tr>
<td align="right"><strong>Level :</strong></td>
<td align="left"><?php echo "$fetch->location" ?></td>
</tr>
</table>
</div>
</body>
</html>
So i hope someone can help me!
Thanks in Advance!
birdbrain24 is offline   Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links