Welcome Guest, Not a member yet? Register   Sign In
table with 2 primary keys update problem
#4

(05-12-2020, 07:14 PM)vitnibel Wrote: In both screenshots, an exception occurs due to "forInvalidFile", when rendering one of the views:

PHP Code:
echo view('templates/headerx'$header);
echo 
view('utils/artrec');
echo 
view('templates/footerfb'); 

Perhaps one or more files were not found or are not where you indicated

This was a great nonsense for those who were starting, 2015, of course, until today, things have not changed that much. The correct one would be a single primary key, id. The two fields, without attributes, are sufficient to make the relationship between player and record, as can be seen below.
Code:
public function getAlbums() {

        $request = \Config\Services::request();
        $uri = $request->uri;
        $id = $uri->getSegment(3);
        $db = db_connect();
        $sql = ("SELECT A.*, PA.* FROM albuns A, players_albuns PA
        WHERE PA.player_id=$id AND PA.album_id = A.id ORDER BY ano, posodr, album_id ASC");
        $query = $db->query($sql);

        return $query->getResult();
    }
The solution was to use a successful page, as in the CRUD tutorial, because in fact the update is done.
I should have already presented the solution but I was in the final steps of converting my site, localhost, from CI3 to CI4, just finished. I can't believe I did it. Big Grin
Thank you very much for your attention
Reply


Messages In This Thread
RE: table with 2 primary keys update problem - by wdeda - 05-15-2020, 02:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB