Jump to content

refuring to other users in the table


R1der

Recommended Posts

ok i am having a problem with this bit of codeing (No errors)

[code]<? if($user['wilderness'] == 1 && $ir['posX'] == $users['posX'] && $ir['posY'] == $user['posY']){
print "{$user['username']}";}?>[/code]

ok i have tried everything i can think of to get this to work,

Basicly i want it to show the username of all users  who is in the same place as them on like a coordinate map kinda thing. But i cant get it to show the users even tho there are users in the same location as them.

This is how it shows

You are currently at (0,0)

North
West          East
South

You are see:
*****(here is where it should show the users)*****


Hope this makes sence
Link to comment
Share on other sites

OK, my advice would be to a) separate the parts of the if statement for readability, b) change the short <? tags for <?php and c) check that your variable names are consistent, as identified by Tyche.

[code]<?php
if(($user['wilderness'] == 1) && ($ir['posX'] == $users['posX']) && ($ir['posY'] == $users['posY'])){
  echo $user['username'];
}
?>[/code]

Also, check the case sensitivity.

If all this fails then we may need a little bit more of the code.

Regards
Huggie
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.