Hey guys, so here’s the deal-- I just want Ajax to do a simple update of a cell in my table, and once the change has been made, obviously show it in real time.
My form field looks like this:
type='hidden' [php]<input id='c_id' value='" . $results['customer_id'] . "' />
<input type=‘hidden’ id=‘words_owned’ value=’" . $results[‘word_balance’] . "’ />
[/php]
While my Javascript is:
[php][/php]
The PHP code that handles it all (updateAjax.php) is:
[php]<?php
include(‘functions.php’);
$customer_id = $_REQUEST['customer_id'];
$db = $registry->getObject('db');
$change = $_REQUEST['new_amount'];
echo $customer_id;
$sql = "UPDATE customers SET word_balance='" . $change . "' WHERE customer_id=" . $customer_id;
$db->executeQuery($sql);
echo $change;
?>[/php]
The problem is that once I click on the form to “add more words” to a customer account, it says “Updating…” but then does nothing else. Any ideas?