Jump to content


Photo

Array


  • Please log in to reply
21 replies to this topic

#21 SieRobin

SieRobin
  • Members
  • PipPipPip
  • Advanced Member
  • 212 posts
  • LocationNew Jersey

Posted 10 August 2006 - 06:09 AM

the market table does have a race column right?We're problaby just missing something simple, a variable set wrong somewhere, that's why I'm asking you to output it all. Try something I forgot, if there's more then 1 row you need to loop through the results heh.


echo 'IID is:' . $inventory3[IID] . '<BR>';

$race_query = mysql_query("SELECT * from market where ID='$inventory3[IID]'");

for ($i = 0; $i < mysql_num_rows($race_query); $i++)
{
$race_fetch = mysql_fetch_assoc($race_query);
$race_data = $race_fetch['race'];
echo 'Database race is: ' . $race_data . '<BR>';
$racearray = explode(", ", $race_data);
echo 'Race Array:<BR><pre>' . print_r($racearray,true) . '</pre>';
}
echo '<BR><BR><BR>Users race is: ' . ($userstats3['race'] . '<BR>';
exit;
	if (isset($equip)) {	
		if ($userstats3['race']==$race||$race=='All') {


No need, I got it thank you :D

The problem was in the IID for the query, I just changed it to IID='$equip' now it recognizes which item it is.
Yet the assoc and the explode I still use, so that still helped me out alot, thank you muchs :D

#22 DylanBlitz

DylanBlitz
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts
  • LocationOC Baby!

Posted 10 August 2006 - 06:10 AM

ah, see, always something other then what you thought the problem was lol. Glad to help out.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users