使用php更新数据库中的信息

I'm quite new to programming, and im trying to update a certain column in a database using php and javascript.

The data base only has 2 columns, seatnums and status. Basically, i want the status to reset back to 1 if the status is currently 0. Could anybody point me in the right direction?

I have a class inside a div in my HTML:

<a class='two' href="javascript:databaseReset() ">Reset</a>

My javascript function (Part im struggling with):

    function databaseReset();
    $.ajax({
        url: "dbreset.php",
        type: "POST",
        data: {
            'seatnum': seatnum,
            'status': '1'
        },
        success: function () {
            alert("ok");
        }

function over(id) {
    selectedseat=$(id).attr('title');
    $(id).attr('src','images/mine.gif');
    $(id).attr('title', 'Available');
}

function out(id) {
    $(id).attr('src','images/available.gif');
}

my php file:

<?php
include("dbconnect.php");

$query="UPDATE seats SET status=1 WHERE status=0";

$link = mysql_query($query);
if (!$link) {
 die('error 2');
}


?>

I assume it was simply a typo, but your function call needs to wrap brackets around the ajax call:

function databaseReset(){   //<---*****Add these braces*****
  $.ajax({
    url: "dbreset.php",
    type: "POST",
    data: {
      'seatnum': seatnum,
      'status': '1'
    },
    success: function () {
        alert("ok");
  }
};  //<---*****Add these braces*******

your code seems to declare the function, but not assign its functionality

Also, the data section is unnecessary, as it is not used. In fact, since you are not posting data, you can use the "GET" method instead.

Beyond that your code looks good, can you please specify what the issue is?