Gayner Posted September 5, 2009 Share Posted September 5, 2009 I want to run a query: Let's say I have a query for a variable: $m = "QUERY HERE"; [code]if(iswon){ if(isplayer){ playerwins[level]++; playerstarts=true; writetext(3); run MY $mb Variable here } Link to comment https://forums.phpfreaks.com/topic/173252-is-this-possible/ Share on other sites More sharing options...
steveangelis Posted September 5, 2009 Share Posted September 5, 2009 What exactly are you wanting to do? Could you be more clear? Link to comment https://forums.phpfreaks.com/topic/173252-is-this-possible/#findComment-913250 Share on other sites More sharing options...
Gayner Posted September 5, 2009 Author Share Posted September 5, 2009 What exactly are you wanting to do? Could you be more clear? YEa sorry ok here: if(iswon){ if(isplayer){ playerwins[level]++; playerstarts=true; writetext(3); jsvar = <?php echo mysql_query("UPDATE ibf_members SET points = points+0.25 WHERE id={$ibforums->member["id"]} LIMIT 1"); ?>; document.write(jsvar); }else{ pcwins[level]++; playerstarts=false; writetext(2); }} See how i try to that PHP? But that query runs EACH TIME I refresh page!! I only want it to run when the javascript iswon function is ran.. HELP! lol Link to comment https://forums.phpfreaks.com/topic/173252-is-this-possible/#findComment-913255 Share on other sites More sharing options...
bundyxc Posted September 5, 2009 Share Posted September 5, 2009 PHP is server-side, and has no way of knowing what the Javascript is doing. I'd recommend trying to just code it in Javascript, or having Javascript redirect to the MySQL query page once your function is run. Link to comment https://forums.phpfreaks.com/topic/173252-is-this-possible/#findComment-913270 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.