Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function create(){
- // очистка
- $this->consumption_id=htmlspecialchars(strip_tags($this->consumption_id));
- $this->product_id=htmlspecialchars(strip_tags($this->product_id));
- $this->vendor_cod=htmlspecialchars(strip_tags($this->vendor_cod));
- $this->recipient_id=htmlspecialchars(strip_tags($this->recipient_id));
- $this->price=htmlspecialchars(strip_tags($this->price));
- $this->quantity=htmlspecialchars(strip_tags($this->quantity));
- $this->size=htmlspecialchars(strip_tags($this->size));
- $this->provider_id=htmlspecialchars(strip_tags($this->provider_id));
- $this->color=htmlspecialchars(strip_tags($this->color));
- $this->name=htmlspecialchars(strip_tags($this->name));
- // запрос для вставки (создания) записей
- $query = "
- INSERT INTO `{$this->table_name}`
- (
- `product_id`,
- `vendor_cod`,
- `recipient_id`,
- `price`,
- `quantity`,
- `size`,
- `provider_id`,
- `color`,
- `name`
- )
- VALUE (
- '{$this->product_id}',
- '{$this->vendor_cod}',
- '{$this->recipient_id}',
- '{$this->price}',
- '{$this->quantity}',
- '{$this->size}',
- '{$this->provider_id}',
- '{$this->color}',
- '{$this->name}'
- )
- ";
- // подготовка запроса
- $stmt = $this->conn->prepare($query);
- // выполняем запрос
- if ($stmt->execute()) {
- return true;
- }
- return false;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement