I have question about database results.
At the moment I have a query that gets the "bewijskaarten" from the database that the user made.
function get_bewijskaarten_current_user($un){ $bewijs_query = ("SELECT * FROM bewijskaarten WHERE username= ?"); if($bewijsstatement = $this->connection->prepare($bewijs_query)) { $bewijsstatement->bind_param('s', $un); $bewijsstatement->execute(); if($bewijsstatement->fetch()) { $bewijsstatement->close(); return true; } } }
now, in this function:
function get_bewijskaarten_from_user($un) { $bewijssql = New Mysql(); $getbewijskaarten = $bewijssql->get_bewijskaarten_current_user($un); if ($getbewijskaarten) { return $getbewijskaarten; } }
I want to make a new object of the class bewijskaart:
public function bewijskaart($bewijskaartid, $kortebeschrijving, $situatie, $taak, $aanpak, $resultaat, $reflectie) { $this->bewijskaartid = $bewijskaartid; $this->kortebeschrijving = $kortebeschrijving; $this->situatie = $situatie; $this->taak = $taak; $this->aanpak = $aanpak; $this->resultaat = $resultaat; $this->reflectie = $reflectie; }
And on the page where user can view the list of their bewijskaarten I want to show them a part of the result of the query (just $kortebeschrijving and $bewijskaartid) in a table.
When they want to see the whole "bewijskaart" they have to select it ($situatie,$taak,$aanpak, $resultaat and $reflectie can be between 1 and 500 varchar).
Is my idea good or is there a better way?
On a other forum they said I had to look at this, but this isn't what I meant.