Your problem is likely that $wpdb->jch_gigs
is undefined. Is jch_
the prefix of your DB tables, as defined in wp-config.php
? If so, try this:
$wpdb->prepare(
"UPDATE {$wpdb->prefix}gigs
SET available = available - %d
WHERE ID = %d",
$quantity,
$item )
);
wpdb
class on the Codex