How do I modify my insert function in order to make it work in php? - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Saturday, June 5, 2021

How do I modify my insert function in order to make it work in php?

I am trying to add something to my database and it is not working, I am not sure how to solve it.. I am new to PHP sorry for the obvious mistakes if any.

public function setProductsStmt($sku, $name, $price, $typeId) {
        $sql = "INSERT INTO Product_table(SKU, Name, Price, TypeID) VALUES (?, ?, ?, ?)";
        $stmt =  $this->connect()->prepare($sql);
        $stmt->bind_param("ssii",$sku, $name, $price, $typeId);
        $stmt->execute();
    }


source https://stackoverflow.com/questions/67842734/how-do-i-modify-my-insert-function-in-order-to-make-it-work-in-php

No comments:

Post a Comment