Hello everyone,
Quite new to jQuery, AJAX and PHP, and all new to this forum

This is probably not a brainer for the experienced, but I simply cannot find out what is wrong.
Let me explain...
I have...
1 HTML page, with a form that submits only 1 field. This page also contains my jQuery / AJAX code.
1 PHP page, with only a few statements to store information in my database.
I am trying to prevent redirection to the PHP page on Submit, which works just fine. However, the submitted field is just not stored in my database table. I have tried different ways of writing my jQuery / AJAX code, still no result.
If I remove my AJAX code, everything works just fine, and the submitted value will be stored in the database. So, the PHP seem fine, to me that is. What I don't want though, is to be redirected to that PHP page.
Firebug reports no errors.
If I catch the result from the PHP-script, it always says Success.

Any ideas? I would really appreciate some help... If I got it all wrong below, feel free to just knock it / me down

Ok, let's have a look at the code: (what am I doing wrong, or just don't understand?)
- On index.php
- $('#Submitted').click(function(){
- var Title = $('#title').val();
-
- $.ajax({
- type: "POST",
- url: "/php/submit_to_db.php",
- data: "mtitle=" + Title
- });
- return false;
- });
- On submit_to_db.php
- $con = new mysqli('localhost', 'user', 'password', 'database');
- $query = "INSERT INTO mytable(mtitle) VALUES(?)";
- $stmt = $con->stmt_init();
- if($stmt->prepare($query))
- {
- $stmt->bind_param('s', $_POST['title']);
- $stmt->execute();
- }
- if($stmt) echo "Stored in database";
- else echo "Unable to store information in database";