Mysqli and PHP form

Mysqli and PHP form
0.0 0

#1

Hi guys, how are you doing:
I’m preparing a comment section on a site.
I have a table name: klyan with the following field (id, | user | pwd | date)
and a second one: komante_klyan(kid | id_kliyan | Auteur_K | dat | mesaj )

I want user from kliyan to be inserted to komante_klyan (Auteur_K) whena user post a comment.
if he or she logged in of course.

HERE IS MY FUNCTION

function setKomante($koneksyon) {

//kreye kondisyon len click bouton an

if (isset($_POST[‘komanteSubmit’])) {

    //kreye variab ki capte done de kliyanyo ak variab $_POST kom method la se POST
    $kuName =$_POST['kuName'];
    $dat = $_POST['date'];
    $mesaj = $_POST['mesaj'];

    //kreye variab sql antre done yo nan tab baz done ya
    $sql = "INSERT INTO komante_kliyan (id_kliyan, dat, mesaj) VALUES ('$kuName', '$dat', '$mesaj')";
    $rezilta = mysqli_query($koneksyon,$sql);
   
    }

}