Webmaster Forum

Ezilon Directory   Keyword Research Tool   V7N Directory
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Reply
 
LinkBack Thread Tools Display Modes
Old 01-14-2008, 08:30 PM   #1 (permalink)
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  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 01-17-2008, 05:38 AM   #2 (permalink)
Contributing Member
 
greenfinger's Avatar
 
Join Date: 01-09-08
Posts: 118
iTrader: 0 / 0%
Latest Blog:
None

greenfinger is on the right pathgreenfinger is on the right path
Have a look at JQuery. It's very easy to use.

You will need to put some effort in, and be prepared to learn.

What it does is, for example, you set up the fields on a form to trigger the Jquery in the background (onclick/onfocus etc), it HTTP POSTS (or GETS, depends on how you configure it) the data to the server and then the reply is sent back to Jquery where it is then placed onto the page inside an element which you specify.

I use this to tell users whether a username is already in use immediately after they have typed it in.

http://jquery.com/
greenfinger is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax & PHP: On the same page? birdbrain24 Coding Forum 1 02-25-2008 02:45 PM
Google Ajax Powered 404 Page Jeffro2pt0 Blogging Forum 2 09-25-2007 07:45 AM
AJAX: bots hitting AJAX scripts kkiely Coding Forum 1 04-21-2007 01:14 AM
AJAX Bredd S Webmaster Revenue 4 08-09-2006 12:59 PM
mysql page problems Limit Coding Forum 4 07-15-2004 06:59 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 11:17 PM.
© Copyright 2008 V7 Inc


Search Engine Optimization by vBSEO 3.1.0 ©2007, Crawlability, Inc.