Script47 Posted April 8, 2013 Share Posted April 8, 2013 if(!$ir['hospital']) What does the variable $ir mean exactly and what does it do? Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted April 8, 2013 Share Posted April 8, 2013 The $ir variable is the variable Mc Code uses to pull "your" information from "your" user table. When I say "your" I mean the player that is on the computer playing. Quote Link to comment Share on other sites More sharing options...
Script47 Posted April 8, 2013 Author Share Posted April 8, 2013 Thanks you Kyle, you may not have noticed but I'm a beginner that's why this question was asked!:) Quote Link to comment Share on other sites More sharing options...
Aventro Posted April 8, 2013 Share Posted April 8, 2013 For the record the $ir variable doesn't make any sense. Yes, I'm talking about the name of it. Quote Link to comment Share on other sites More sharing options...
Razor42 Posted April 8, 2013 Share Posted April 8, 2013 Told you that already! :P Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted April 8, 2013 Share Posted April 8, 2013 For the record the $ir variable doesn't make any sense. Yes, I'm talking about the name of it. I think it makes sense if you make something out of it like "i" (as in myself) "r" (as in result) since the devs of mc use $r for pretty much everything else :p But to make my last post a little more clear just incase it didnt really sink in, for example im user id 2 and your user id 1 I can only see the information being passed as an ir var for user id 2 and you cant see what "ir" for user id 2 only user id 1 ir vars Quote Link to comment Share on other sites More sharing options...
runthis Posted April 8, 2013 Share Posted April 8, 2013 Since $r is a short for return, i am assuming $ir is short for Id Returned Quote Link to comment Share on other sites More sharing options...
Zettieee Posted April 8, 2013 Share Posted April 8, 2013 It's an array of data? It's something like this (I assume.) $run = mysql_query("SELECT * FROM user WHERE id = '".$_SESSION['id']."'"); $ir = mysql_fetch_array($run); Outside of mccodes this wouldn't have any meaning. Quote Link to comment Share on other sites More sharing options...
sniko Posted April 8, 2013 Share Posted April 8, 2013 It's an array of data? It's something like this (I assume.) $run = mysql_query("SELECT * FROM user WHERE id = '".$_SESSION['id']."'"); $ir = mysql_fetch_array($run); Outside of mccodes this wouldn't have any meaning. Unless you had a table called `users`, with the column `id`, and a session with the index `id` ;) Quote Link to comment Share on other sites More sharing options...
Zettieee Posted April 9, 2013 Share Posted April 9, 2013 He means the $ir variable is poor use of naming and anywhere but MC code would use something to reflect what it is doing, I think... I was giving an example sniko lol.. dont use mcc and only know some vars because of the conversions to GRPG lol Quote Link to comment Share on other sites More sharing options...
Script47 Posted April 9, 2013 Author Share Posted April 9, 2013 Unless you had a table called `users`, with the column `id`, and a session with the index `id` ;) I think it is, I'm not a pro at MCCodes, but I asked a few senior's and they said yep!:) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.