Jump to content

YoungNate_Black_coder

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

About YoungNate_Black_coder

  • Birthday 10/06/1992

Profile Information

  • Gender
    Not Telling

YoungNate_Black_coder's Achievements

Member

Member (2/5)

0

Reputation

  1. all of the above becuase i was just getting an error before with the die but i removed it and it works fine now , i figured it out own my own with some debugging but is this a good way of going about this because im feeling like my hosting sucks because its takes forever for theese scripts to get executed.....
  2. i want to kno if im going about this corectly i want to update a some database values and delete some values apon a certain time and this cod sits on a cron job runiing every5 mins tell me if ive done anything wrong? <? // grab all clutches and check if they are due yet $con = mysql_connect('localhost','xxxuser','xxxpass'); mysql_select_db('ab6691_snakesbay_game',$con); $all = "SELECT * FROM cluth"; $clu = mysql_query($all)or die(mysql_error()); $all = mysql_fetch_assoc($clu)or die(mysql_error()); // check if they hatched yet while($all = mysql_fetch_assoc($clu)){ $now = strtotime(date("Y-m-d h:i:s")); $due = strtotime($all['due_date']); $id = $all['id']; echo "clutch id : $id"; if($now >= $due){ $all_s = "SELECT * FROM snakes WHERE `clutch_id` = '$id' "; $al_s = mysql_query($all_s); while($snake = mysql_fetch_assoc($al_s)){ // change for everyone! $sid = $snake['snake_id']; $sql = "UPDATE `ab6691_snakesbay_game`.`snakes` SET `staus` = 'nu' WHERE `snakes`.`snake_id` = '$sid'"; mysql_query($sql)or die(mysql_error()); echo "Snakes Have been Updated...<br>"; } $sql = "DELETE FROM `ab6691_snakesbay_game`.`cluth` WHERE `clutch_id` = '$id' "; mysql_query($sql)or die(mysql_error()); }else{ echo "the clutch woth the id <u>$id</u> Does not need to be updated "; } // delete that clutch $del = "DELETE FROM `ab6691_snakesbay_game`.`cluth` WHERE `cluth`.`id` = $id"; mysql_query($del)or die(mysql_error()); } echo "</table>"; ?>
  3. bu im calling for all rows like : select all from table where sex = 'female' and (if she is not pregnant)???? thiss will return all female snakes that isnt pregnant....
  4. okay so i changed my database structure to timestamp and when the snake gets pregnant i store now(), now in the same insert query how do i add 20 mins to that and check if that 20 mins has been passed on another page?
  5. i wanna query a database table for all rows by this id except this id ???
  6. and what should the timestamp structure be in mysql ?? because right now it is varcher jut because i wanted to be able to say ex. jan, 9 , 2011.... and whats the format for inputing the time now into the database?
  7. okay so i wanna how would i go about doing this? i want when my pregnant function takes place on my website i want to store a value in the database and when a ceritan time has been met i update the datbase to change a value in the database : like when the form is submitted chang a value to pregnant then store it in a database then when 20 mins pass change that to not pregnant ????
  8. okay, so im still working on this game and i was wonder is there anyother good rand functions out there?? like ay i have an array: array(dcvfvfvr,evrvgtfv,fvfvrfv,vfvfgvr,,fvergtvv) and i wanted to randomly select one of those values inside a foreach loop maybe untill it hits a certain number?
  9. let me give a better mark up after query and query after user post the form this is what im left with ex. albino/pastel/spider/ ex. pied/pastel/ ex. dram/bee those are three different random examples so say that first one is a male and that second is a female they are passed into the function like so $male = ....... $female = ...... i want to explode by the / ex. $traits = explode('/',$male); giving me an array .... now that i have this array with just the genetic background in it (ex. pied albino pastel) any pointers on a breed function from there with an array like that?
  10. what i mean is i like your code it works but thats not my format .... im asking is there a way to explode the array into varibles with keys then shuffle them to determine 1 snakes traits and then continue that procces over the random number givens for potential offspring?
  11. thanks for the help buddie your code was most helpful but i think i could have been a little clearer..... the main trait of the snake would be its base morph ex. albino (witch is aN rec Trait) and every thing its het for sits on a another row like such pastel /spaider/...../.... so that when i query and pass the info through a an option of an select menu the value togther would look like this: <option value=\"$base/$het\">$.....</option> so when the useer decides to breed the post data will look like this... ( base/het ) ex. or equily albino/pastel/spider then i explode by the forward slash (/)albino (/)pastel (/)spider now i have them in an array how do i get them alone like a loop? $trait[] = albino $trait[] = pastel $trait[] = spider $trait[] = ..... $trait[] = ..... then count ?????? im stuck but u did answer a very big question and for that i thank you sincerly!!!! i was wonder did i have to right out all the possible difernt combonations amongset the three traits or was there a faster way and u just showed me that that is the only way ..... lol! how would i go about seperating that array after the explosin?????
  12. okay so im making a ball python breeding game and im currently working on it right now and now im at the most important part fo the game the breed function!!!! now i l explain how it should work beacuse i dnt have any code yet for the function, but the rest of the site is done okay in a ball python breeding action in real life would go something like this : male + female = child now the male and female snake will have traits that will determine what the child is example there are three different king of traits for ball pythons co-dom , dom , and Rec codom - half domanant traits dom - compleatly dominant traits and rec - where both snakes are required to carrie the trait in order to produce it .... now i have some test snakes in my database like this id - morph(base morph) - het (enum yes or no) - and gen (.... whatever the snake traits are) so what i did was start by placing the traits with slashes that i will explode with ex. spider/pastel/enhi now i will use the base morph name ex. cinnimon ball. now here is where i need help after explod() i have any array i wanna run the if stament if they carry the same traits but it will be dynamic so i wont no where to implode ?? and i wanna kno is there a way to place dynamic varrable into an array say after they have bred i wanna give a random number of eggs then randomize what will hatch out them eggs any help would be greratly appreciated and admin if this is considred to be spam i apologize i love this forum and i dnt mean to spam if(this is considered to be spam){ echo "Sorry PHPFREAKS.COM"; }ELSE{ echo "THANKS FOR THE HELP"; }
  13. function get_inc(){ $clutches = "SELECT * FROM cluth WHERE uid = '$id'"; $clu = mysql_query($clutches)or die(mysql_error()); $result = mysql_fetch_array($clu,MYSQL_ASSOC); $i = 1; echo "<tr><td>Number.</td><td>clutch Size.</td><td>Worth</td></tr>"; while($result = mysql_fetch_array($clu,MYSQL_ASSOC)){ $cid = $result['id']; $sire = $result['sire']; $dame = $result['dame']; $datel = $result['date_layed']; $size = $result['size']; $price = $result['price']; echo "<tr><td>$i.</td><td> <a href=\"?room&height=350&width=520&modal=true\" class=\"thickbox\" title=\"$sire+$dame\"> ($size) Egg Clutch</a> </td><td>$price</td></tr>"; $i++; } }
  14. i havent wrote it up yet its just an if statement as followed: if(!isset($_SESSION['country'])){ header('location :post.php?'); }else{ ........
×
×
  • 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.