SHARE
TWEET

Untitled

a guest Jun 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(!empty($category_new)) {
  2.     $query = 'INSERT INTO category (name) VALUES ("'.mysql_real_escape_string($category_new).'");';
  3.     $mysql->execute($query);
  4.     if(isset($_POST['new_category']) && $_POST['new_category'] == 1) {
  5.         $query = 'SELECT id FROM category WHERE name = "'.mysql_real_escape_string($category_new).'" ORDER BY id desc LIMIT 1;';
  6.         $result = $mysql->execute($query);
  7.         if($row = mysql_fetch_object($result)) {
  8.             $newcatid = $row->id;
  9.             $query = 'INSERT INTO `game_category` (`game`, `category`) VALUES ('.$object.', '.$newcatid.');';
  10.             $mysql->execute($query);                                   
  11.         }
  12.     }
  13. }
RAW Paste Data
Top