Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function __construct($id)
- {
- $this->PersonArray[]=array();
- $this->ID=$id;
- $connect = mysqli_connect("localhost","root","");
- If (!$connect)
- {
- Die('could not connect: ' .mysqli_error());
- }
- $databaseSelected=mysqli_select_db($connect,"oplatek");
- $sqlRequest="SELECT * FROM `users`;";
- $id=0;
- $result=mysqli_query($connect,$sqlRequest);
- if ($result->num_rows > 0)
- {
- while($row = $result->fetch_assoc())
- {
- $id++;
- $User=$row["name"].' '.$row["Surname"];
- $this->PersonArray[]=new Person($id,$User);
- }
- }
- mysqli_close($connect);
Advertisement
Add Comment
Please, Sign In to add comment