On May 6, 2:57 am, John <[EMAIL PROTECTED]> wrote:
> I have the same question. I have over 20k rows of data in mysql, and
> the idea is for there to be an update button beside each row. I don't
> see any examples of how to interact with the database here -- in php
> it's $sql = "..."; in ruby/rails it's Thing.new[...], but what's up
> with jquery?

You should first learn how to write a simple php page that interact
whit the database. For example, this is a simple script that delete a
record:

mysql_connect(HOST,USER,PASS);
mysql_select_db(DB);

if ($_GET['id']) {
     if (mysql_query("DELETE FROM table WHERE id='" . $_GET['id'] .
"')) {
       echo "deleted ok";
     }
     else {
      echo "deleted ko";
     }
}

Then you can call this page whit an jQuery Ajax request and if the
returned value is "deleted ok" perform the jQuery effect you want.
Hope it helps you!

Reply via email to