I am currently modifying a 3rd party social media clone to fully work with Phoenix, currently works locally but not live, with that in mind I am creating this thread to ask questions where there is code that I am not sure how to convert to the Phoenix standard.
There are also some concerns over the fact the addon has it's own db connection that I would like to move away from, hence the code updates.
So here is my first issue, the below section of code puts a post into the db and returns the id to be used in later code.
Code: Select all
$query = mysqli_query($this->con, "INSERT INTO posts VALUES ('', '$body', '$added_by', '$user_to', '$date_added', 'no', 'no', '0', '$imageName')");
$returned_id = mysqli_insert_id($this->con);Code: Select all
$query = tep_db_query("INSERT INTO posts VALUES ('', '$body', '$added_by', '$user_to', '$date_added', 'no', 'no', '0', '$imageName')");
$returned_id = mysqli_insert_id($this->con);Any help would be appreciated.