# \[php\] noob \> triggering msql query

**URL:** <https://forum.kirupa.com/t/php-noob-triggering-msql-query/202239>\
**Category:** Uncategorized\
**Created:** [September 28, 2006, 10:25pm UTC](https://forum.kirupa.com/t/php-noob-triggering-msql-query/202239 "2006-09-28T22:25:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaelic](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@Gaelic](https://forum.kirupa.com/u/Gaelic)\
**Post date:** [September 28, 2006, 10:25pm UTC](https://forum.kirupa.com/t/php-noob-triggering-msql-query/202239/1 "2006-09-28T22:25:57Z")

</div>

I’m too used to Dreamweaver and add ons that I never really learned any normal PHP programming (well a lot but not everything heh).

```php
  <?php 
  $result =$_SESSION['kt_userCredits'] + $_SESSION['kt_userMoney'];
  $sql = "UPDATE User SET userMoney = userMoney+userCredits, userCredits = 0 WHERE userID = 'userID'"; ?>
  <? echo $result ?>.</p>
  
  <?php if (!isset($_GET['action'] == "collect")) {
    mysql_query($sql);
    } ?>

```

I have been trying to get this to work for a long time now. After playing a Flash game, the score gets sent to row userCredits.

I first tried making a form that would have a button that would cause the update, but after 3 days of struggling with that, I ran out of ideas…

I guess something’s wrong with the GET function… if someone could help me out, that’d be greatly appreciated :hugegrin:
