How to Modify this Itemizer.php

Virtue

New member
Messages
259
Points
0
<html> <head> <title>Event Rewards Log</title> </head> <body><center><font size=16>Prizes given for events!</font><br /><font size=4>Event Reward Logs~</font><br /><br /> <table border='1'> <tr> <td>Character</td> <td>Received</td> <td>Quantity</td> <td>Date</td> <td>From</td> </tr> <?php //------------------------- // By Pancake with the help of #rathena at irc://irc.rathena.net //------------------------- // Connect to database server mysql_connect("127.0.0.1", "User", "Password") or die (mysql_error ()); // Select database mysql_select_db("rathena_rag") or die(mysql_error()); // SQL query $strSQL = "SELECT * FROM itemizer ORDER BY id DESC"; // Execute the query (the recordset $rs contains the result) $rs = mysql_query($strSQL); // Loop the recordset $rs while($row = mysql_fetch_array($rs)) { echo "<tr>"; echo "<td>" . $row['char_name'] . "</td>"; echo "<td>" . $row['item_name'] ."</td>"; echo "<td>" . $row['item_amount'] ."</td>"; echo "<td>" . $row['when'] ."</td>"; echo "<td>" . $row['by_gm'] . "</td>"; echo "</tr>"; } echo "</table>"; // Close the database connection mysql_close(); ?></center> </body> </html> 
 
I want to add a pagination for the Index and another query
 
 
 

<td>Claimed</td> 



Code:
echo "<td>" . $row['collected'] . "</td>"; 
But I want it to show Yes or No. if you put the code i just made it just shows 1 or 0

 
For the collected or uncollected items, try this:

echo "<td>" . ($row['collected']) ? "Yes":"No" . "</td>";

For pagination, I was never good in PHP but it'd be some GET data with the start of the fetching and the number of rows you'd want to return.

I don't remember if that line of code I sent you works, though.

 
i'll try that now thanks
default_smile.png


 
Try this

Code:
if ($row['collected'] == 0){echo "<td>No</td>";}else{echo "<td>Yes</td>";} 
 
Back
Top