hello everyone, i am in need of some advice. You see i created an application to manage a large user base, this user base has additional hidden data per user that is in the form of a drop down. My problem is that 1k to 5k of users is fine, the app handles well within reason and is completely usable BUT when i hit number like 20k 50k and 200k thats when my speed truly suffers. Is there a way to speed this up, this is currently the method im using to populate and create the data in the database on a table
<table>
<tbody>
$query=mysqli_query($con, "SELECT * FROM userprofile")or die(mysqli_error($con));
while($row=mysqli_fetch_array($query)){
$id=$row['id'];
<script>
function changeText(idElement) {
var element = document.getElementById('back' + idElement);
// this script is for processing each HTML element of a specific string and changing it on user click
// I used echo row-number as a way to go through each row to find the proper label, in my case should be the first header
for (var i = 0; i <= <?php echo $rownumber;?>; i++) {
i = i++;
if (idElement === i) {
if (element.innerHTML === '[+]') element.innerHTML = '[_]';
else {
element.innerHTML = '[+]';
}
}
}
}
</script>
<tr>
<td width="5%"><center>
<div title="Show more Details for <?PHP echo @$row['username'];?>">
<!-- I used php echoes to get the data stored in my php script and use it in my html/javascript -->
<!-- this individual column is important because it has all the functionality for expanding and collapsing the nested table -->
<a id="back<?php echo $rownumber;?>" onClick="javascript:changeText(<?php echo $rownumber;?>)" href="#row<?php echo $rownumber;?>" data-toggle="collapse" data-target="#row<?php echo $rownumber;?>" class="btn accordion-toggle">[+]</a>
</div>
</center></td>
<!-- each one of these access values that are stored under a specified header in the database -->
<td><?php echo @$row['subsciber_account_number'] ?></td>
<td><?php echo @$row['company'] ?></td>
<td><?php echo @$row['username'] ?></td>
<td><?php echo @$row['contact'] ?></td>
<td><?php echo @$row['email'] ?></td>
<td><?php echo @$row['phone'] ?></td>
<td><?php echo @$row['city_state'] ?></td>
<td><?php echo @$row['log_history'] ?></td>
<td><?php echo @$row['permission'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
im sure this is not the most elegant way but now i need to figure out a way to make the code MUCH faster so the user base will have more freedom to expand. In all honesty im projecting upt o 2m+ but for now id like to get 200k working at a reasonable speed
my database type is InnoDB
im running the latest version of php through xampp
im still somewhat of a beginner as almost everything i know is self taught
thank you for any and all guidance and assistance, always love learning about new things especially when they are code related