Computing.Net > Forums > Database > PHP / MySQL Problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP / MySQL Problem

Reply to Message Icon

Name: suspect52732
Date: October 10, 2007 at 14:38:19 Pacific
OS: XP
CPU/Ram: 2.4/512
Comment:

I have a rating script that works great. What I am tring to do, is each time a user votes, I will add some voting expierence to there account. This code seems to have a glitch in it. It works, and does what it is supposed to. However, when I put this code in, you have to refresh the page to view the results, without this code, you dont have to refresh the page to view the code. Any ideas? Perhaps my code is written poorly?


if($session->logged_in){
$req_username = $session->userinfo['username'];
$query = mysql_query("SELECT * FROM users WHERE username = '$req_username'");
$myExp = mysql_fetch_assoc($query);
$myVoteExp = $myExp['voteExp'];
$myVoteExp = $myVoteExp + 1;
$query = mysql_query("UPDATE users SET voteExp = '$myVoteExp' WHERE username = '$req_username'");
$applyMyExp = mysql_fetch_assoc($query);
}



Sponsored Link
Ads by Google

Response Number 1
Name: suspect52732
Date: October 10, 2007 at 14:40:31 Pacific
Reply:

Sorry if the last bit was confusing...

However, when I put this code in and use it, you have to refresh the page to view the results of the vote cast. When I leave this code out, you dont have to refresh the page to view the voting results. Any ideas? Perhaps my code is written poorly?


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: PHP / MySQL Problem

Php mysql www.computing.net/answers/dbase/php-mysql/464.html

PHP / MySQL Retrieve one record www.computing.net/answers/dbase/php-mysql-retrieve-one-record/255.html

MySQL: Storage Engine/Field Type www.computing.net/answers/dbase/mysql-storage-enginefield-type/268.html