ajax to refresh database.

Associate
Joined
11 Oct 2008
Posts
268
At the moment when I click my link

<a href="/?movement=up">Move up</a>

it loads the following code which updates my mysql database.

PHP:
<?php

    if ($movement == "up")
{
    $sql = 'UPDATE movement SET pos_x = pos_x-25 WHERE id=1';   
    $statement = $dbh->prepare($sql); 
    $statement->execute();
    echo $load;
}

?>
it then refreshes the page, thats what the $load does. However that gets in the way of a music file I have playing in the background forcing it to restart everytime the database is updated.

I know you can use ajax/jquery to update the database without having to refresh the whole website but I have no ajax or jquery experience what so ever.

If its not too much work, if someone would be willing to code it for me, I will gladly pay for their time with paypal.
 
Back
Top Bottom