Jump to content
  • 0
Sign in to follow this  
Virtue

How to Modify this Itemizer.php

Question

 

 

	<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> 

 

 
 

 

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

 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 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.

Share this post


Link to post
Share on other sites
  • 0

Try this

 

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

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.