Hi! I am something of a noob, working on my first yii2 application and i am stuck.
In a module, i need to use some functions from another php file, one made by me. I am trying to create a comment section. (i made it outside of the application, but i don’t know how to reproduce it in the framework)
My echo and 99% of it’s content isn’t not showing in this question.
I need to use:
function setComments($conn) {
if (isset($_POST[‘commentSubmit’])){
$uid = $_POST[‘uid’];
$date = $_POST[‘date’];
$message = $_POST[‘message’];$sql = "INSERT INTO comments (uid, date, message) VALUES ('".$uid."', '".$date."', '".$message."')"; $result = mysqli_query($conn, $sql);
}
}
I tried to use the include, require with namespace but i got an error. I couldn’t find a solution.