I'm facing a problem about inserting data into MySQL database.
public function insert($setTable, $setRow, $setValues) {
$row = join(", ", $setRow);
$values = join(", ", $setValues);
$result = mysqli_query($this->connect, "INSERT INTO $setTable ($row) VALUES ($values)");
return $result;
}
$currentLink = "test";
$st = 2;
$ide = 0;
$objMysql->insert("url", array("id_transaction", "id_user", "url"), array("$st", "$ide", "$currentLink"));
This is not working. What's wrong with my code?