Well, I have a flea here, behind the ear and I can not solve the following problem:
$select = $mysqli->query("SELECT * FROM payments WHERE client_email='$xemail'");
$row = $select->num_rows;
$linhas = 0;
while($linhas < $row) {
$get = $select->fetch_array();
$top_1 = $get[0];
$top_2 = $get[1];
$top_3 = $get[2];
$top_4 = $get[3];
$top_5 = $get[4];
$top_6 = $get[5];
$top_7 = $get[6];
$top_8 = $get[7];
$top_9 = $get[8];
$top_10 = $get[9];
$top_11= $get[10];
$top_12 = $get[11];
$linhas++;
}
echo '<div id="transaction_id">'.$top_2.'</div>';
echo '<div id="client_email">'.$top_3.'</div>';
echo '<div id="payment_method">'.$top_4.'</div>';
echo '<div id="payment_method_transaction">'.$top_5.'</div>';
echo '<div id="transaction_status">'.$top_6.'</div>';
echo '<div id="transaction_date">'.$top_7.'</div>';
echo '<div id="transaction_date_last">'.$top_8.'</div>';
echo '<div id="product">'.$top_9.'</div>';
echo '<div id="product_value">'.$top_10.'</div>';
echo '<div id="client_name">'.$top_11.'</div>';
echo '<div id="status">'.$top_12.'</div>';
Basically this will get all the purchases made to that customer's email. But the problem is that the variables could not be called $ top_1, they should get an additional number each time the loop repeats, after top_12 and goes back to top_1, instead of top_1 and top_13, and so on. .. and give an echo in the variable to be able to get it in CSS ... I do not know if this title would be ideal, but I looked for it on Google and found nothing, I honestly did not know how to search for this problem ... :(
What I want to do is take all the data from the purchases and display them on a page to the customer. The system will read about 5 records and then it will display page 2, and so on ... I do not even know if this script is the best way to do that ... but it was the one I tested and gave + - right. Is it possible to create these variables with different names as the loop repeats itself? Is there a better way to do this?