Jump to content

little help with this query


Shadowing

Recommended Posts

made a small example as simpliest as possible.

 

I'm trying to do is only select the row if x is equal to $x but i have to do some math on some columns to see if its equal to

little confusing hope someone knows what im trying to do

 

 

$x = 2;


Select id from travel where x = defender_x + defender_y "but only select it if its also equal to $x"

Link to comment
Share on other sites

oh wait a sec i know whats going on now, the way i was doing it was correct.

my example was incorrect

 

i did this statement a week ago and looked at it now and thought it was wrong but it is correct if all those columns with the math is equal to

the variable

 

$travel3 = "SELECT defender_gbx FROM travel WHERE 
			'".($session_x)."' = CEIL((attacker_gbx + ((defender_gbx - attacker_gbx) * ((UNIX_TIMESTAMP() - sent_time) / (arrived_time  - sent_time)))) / 600)
			AND
			'".($session_y)."' = CEIL((attacker_gby + ((defender_gby - attacker_gby) * ((UNIX_TIMESTAMP() - sent_time) / (arrived_time  - sent_time)))) / 450)
			AND stance <> 1 AND stance <> 5 AND stealth_tech <= '".($_SESSION['stealth'])."'";

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.