samedi 21 décembre 2019

how to create a user based posting system?

I made the post form I made the post table there is a field called email_id I want to join with the user id when the user has posted what to do so let the email_id field of the postfes table automatically fill in with the user id that made the post?

this my model

public function getPostModel4()
{

    $query = "SELECT `postfes`.*, `user`.`id`
    FROM `postfes` JOIN `user`
    ON `postfes`.`email_id` = `user`.`id`
    WHERE `postfes`.`email_id` = '" . $_SESSION['id'] . "'";

    return $this->db->query($query)->result_array();
}



Aucun commentaire:

Enregistrer un commentaire