Php Mysql Ajax Inline Update

Hi folks, a new question:

I need to make a search with certain parameters and I want to be able to edit the result list in line, but I have not being able to make it work...

Any help would be greatly appreciated.

Cheers!
Rodric MacOliverResearcherAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
Please show us what you are doing by using the SSCCE.  We need to see your test data and the exact output you want to get from the process, along with any code you have already written.  I am sure that once we have the test data and the expected output we can offer some guidance.
0
Rodric MacOliverResearcherAuthor Commented:
Ray, I tried several of the already developed like the Jeditable, but since JQuery is a novel experience for me I stumble on almost everything...

If I could get a simple example explained I think it would be extremely helpfull...

What I want is to receive a response from a query like one or a couple of records from an MySql database and the listed results be editable...

Thanks for the atention...

Cheers!
0
RobOwner (Aidellio)Commented:
It would really help to show us what you've already got.

I'll cover the basics below but you will need to improve upon them to suit your needs.

the basics for the search are:
a form with a textbox and submit (search) button
<form method='post' action='results.php'>
<input type='text' name='search' />
<input type='submit' value='submit' />
</form>

Open in new window

This posts to your php and i'm not going to go through
<html>
<head>
....
</head>
<body>
<form id='edits' name='edits' action='update.php' method='post'>
<?php
// use $_POST['search'] and query your database
// output the results to a div within any structure you link eg <table> whatever
// make sure the id of the div will be unique and match a unique id in the db
?>
<input type='submit' value='submit' />
</form>
</body>
</html>

Open in new window


The javascript for the above page (using jQuery to make things easier)
$(document).ready(function() {
   $('#edits').find('div').click(function() {
      // each time a div is clicked hide the div, create an input element with the div contents
      $(this).hide();  // hide the div
      $(this).parent().append('<input type="text" name="'+$(this).id+'" value="' + $(this).text() + '"');
   }
});

Open in new window


then when you submit the form to update.php you take the values in the $_POST global and update your database.

This is a very simplified version given you have provided no code.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ray PaseurCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AJAX

From novice to tech pro — start learning today.