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
https://forums.phpfreaks.com/topic/267595-little-help-with-this-query/
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'])."'";

Archived

This topic is now archived and is closed to further replies.

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