function new_pot() { if (!empty($_POST['new_event_name']) && !empty($_POST['new_event_loc'])) { // CREATE EVENT create_event($_POST['new_event_name'], $_POST['new_event_loc']); $pid = latest_event_id(); } else { $pid = $_POST['event_id']; } if (create_pot($_POST['title'], $_POST['currency'], $pid)) { $pot = get_last_pot(); my_exit("success", "Pot created", $pot); } else { my_exit("error", "Could not create pot"); } }
<?php $bool = create_pot("POT TEST"); $pots = get_user_pots(); ?> <pre> <?php echo $bool . "\r\n"; ?> <?php print_r($pots); ?> </pre>