<?php
	include 'inc/conx.php';
	
	$cat_name = (trim($_POST['cat_name']));
	
	$sql = $db->query("INSERT INTO categories (name) VALUES ('$cat_name')");
	$sel = $db->query("SELECT * FROM categories WHERE name = '$cat_name'");
	$id  = $sel->fetchArray();

 		echo '<option value="'.$id['id'].'">'.$cat_name.'</option>';

	die();
?>

