(2:49:58 PM) Dennis Kupec: its been a week and i still havent got this php script to work (2:50:08 PM) Neil Vallon: jesus (2:50:17 PM) Dennis Kupec: i have no idea what im doing wrong (2:50:24 PM) Neil Vallon: everything (2:50:33 PM) Dennis Kupec: probably. u should look at it (2:51:02 PM) Neil Vallon: probably should... hold on let me take some antidepresents first (2:51:40 PM) Neil Vallon: maybe some lithium (2:51:52 PM) Dennis Kupec: tylenol (2:51:53 PM) Dennis Kupec: http://pastebin.com/1SW1hwvN (2:54:14 PM) Neil Vallon: annnnd im back.. swallowed a battery (2:54:48 PM) Dennis Kupec: electrolytes help too (2:54:49 PM) Neil Vallon: oh dear god sockets (2:55:40 PM) Neil Vallon: allright... you explain what thats suposed to do.. im actualy going to go need tylenol for this (2:56:12 PM) Dennis Kupec: ping server, if online update data in database, else place 0's and set status to 1 more than what it was (2:56:15 PM) Dennis Kupec: and do that to all rows (2:57:14 PM) Dennis Kupec: also at he end check for rows with statuses that are equal to or greater than 2880 and delete those rows (2:58:04 PM) Neil Vallon: does the ping work (2:58:08 PM) Dennis Kupec: ya (2:58:21 PM) Dennis Kupec: (2:58:27 PM) Neil Vallon: what isnt (2:58:30 PM) Dennis Kupec: 25565 (2:58:34 PM) Dennis Kupec: the sql updating (3:00:22 PM) Neil Vallon: so you loop the whole DB and update whether online or not (3:00:29 PM) Dennis Kupec: ya (3:02:00 PM) Neil Vallon: status=status+1 is that valid sql? (3:02:05 PM) Dennis Kupec: ya (3:02:31 PM) Dennis Kupec: (3:02:37 PM) Dennis Kupec: the script works and dosent spit out errors (3:04:48 PM) Neil Vallon: Ive never seen AND used in an UPDATE (3:05:08 PM) Dennis Kupec: should be a comma but dosent spit an error (3:05:20 PM) Neil Vallon: but does it work (3:05:37 PM) Dennis Kupec: no? (3:06:16 PM) Neil Vallon: then for christ sake try commas (3:06:24 PM) Dennis Kupec: k (3:06:47 PM) Dennis Kupec: and the integers doine neeed the quotes (3:07:09 PM) Neil Vallon: no (3:07:52 PM) Dennis Kupec: didnt help the issue (3:09:06 PM) Neil Vallon: it is looping rite (3:09:11 PM) Dennis Kupec: ya (3:09:17 PM) Dennis Kupec: it works for looping rows (3:11:36 PM) Neil Vallon: could it be something with your guid's (3:12:48 PM) Dennis Kupec: no because it exists (3:13:12 PM) Neil Vallon: whats an example of a guid (3:13:48 PM) Dennis Kupec: cy4xMzc1NzIxOTcwLkJRQndnUFlGb0M3WnhDN1dEZlRZTzZHMlRzY05MWTluT0xVNUFTTFk= (3:14:21 PM) Neil Vallon: so not an issue of something being escaped... whats the datatype on that (3:14:41 PM) Dennis Kupec: varchar (3:15:47 PM) Neil Vallon: uhhhhhhhhhhh.... (3:16:18 PM) Neil Vallon: try doing that part by id (3:16:29 PM) Neil Vallon: $guid = $row['id']; (3:16:35 PM) Dennis Kupec: ya (3:16:38 PM) Neil Vallon: WHERE id='$guid'" (3:17:48 PM) Dennis Kupec: nope (3:19:21 PM) Neil Vallon: and the 'lastrefresh' update does work? (3:19:28 PM) Dennis Kupec: yup (3:19:58 PM) Neil Vallon: get rid of the $con2 and just use $con for everything (3:20:15 PM) Dennis Kupec: but then itl keep a shit ton of connections open (3:20:49 PM) Neil Vallon: no it wont.. right now your opening a shit ton... that will just open one and keep it open (3:21:04 PM) Dennis Kupec: k. well it didnt change anything (3:21:14 PM) Neil Vallon: son of a bitch (3:21:55 PM) Dennis Kupec: now captchas arent working. kill me. (3:22:15 PM) Neil Vallon: oh thats been broken for a while (3:22:24 PM) Neil Vallon: meanin to tell ya (3:23:48 PM) Neil Vallon: get rid of "WHERE guid='$guid'" entirely and make sure its atleast touching the DB (3:23:55 PM) Dennis Kupec: k. (3:25:28 PM) Dennis Kupec: didnt do anything (3:25:43 PM) Neil Vallon: var_dump($row) (3:26:15 PM) Dennis Kupec: it dumps (3:26:26 PM) Neil Vallon: lol (3:27:04 PM) Dennis Kupec: result dumps too (3:27:12 PM) Neil Vallon: var_du... damn (3:27:36 PM) Dennis Kupec: the numbers dump as strings but thats not a problem i dont think (3:28:05 PM) Neil Vallon: echo something on both sides of the if and see which path its taking so i can focus on one (3:28:34 PM) Neil Vallon: whats the datatype of status in the DB? (3:28:51 PM) Dennis Kupec: integer and its going else (3:30:09 PM) Neil Vallon: mysqli_query($con, "UPDATE `serverlist` SET players=1337"); (3:30:26 PM) Neil Vallon: sanity check to see if its posible to get something to work (3:30:50 PM) Dennis Kupec: worked (3:31:07 PM) Dennis Kupec: im gonna try pdo real quick (3:31:27 PM) Neil Vallon: mysqli_query($con, "UPDATE `serverlist` SET players='$cp'"); (3:32:13 PM) Dennis Kupec: that dosent work (3:32:27 PM) Neil Vallon: mysqli_query($con, "UPDATE `serverlist` SET players=$cp"); (3:32:51 PM) Dennis Kupec: nope (3:33:10 PM) Neil Vallon: $cp = (int) $result[3]; (3:33:34 PM) Dennis Kupec: wait wait wait 1 sec (3:33:57 PM) Dennis Kupec: $cp will be 0, gonna use mxp instead (3:34:11 PM) Neil Vallon: yaaaa... (3:34:40 PM) Dennis Kupec: yaaa that did nothing (3:34:46 PM) Dennis Kupec: i echoed the value and its there (3:34:58 PM) Neil Vallon: neither of them? (3:35:16 PM) Dennis Kupec: 1 sec let me try casting them as integers (3:35:32 PM) Dennis Kupec: that didnt work either (3:35:41 PM) Neil Vallon: ffs (3:36:04 PM) Neil Vallon: mysqli_query($con, "UPDATE `serverlist` SET players=".$cp); (3:36:38 PM) Dennis Kupec: nope (3:37:09 PM) Neil Vallon: ok... revert back to what you sent on pastebin (3:37:26 PM) Neil Vallon: $cp = "5"; (3:38:12 PM) Dennis Kupec: i changed both values, didnt work (3:38:31 PM) Neil Vallon: da actual fuck (3:38:49 PM) Dennis Kupec: this has no reason why it shouldnt work (3:39:15 PM) Dennis Kupec: WAIT (3:39:18 PM) Dennis Kupec: i remeoved the ANDs (3:39:19 PM) Dennis Kupec: and it worked (3:39:41 PM) Neil Vallon: put the query string into a separate variable and echo that out (3:41:04 PM) Dennis Kupec: (3:42:38 PM) Neil Vallon: for the fuck of it... `backtick` the column names and unquote the values (3:43:42 PM) Dennis Kupec: k (3:44:33 PM) Dennis Kupec: nope (3:45:03 PM) Dennis Kupec: maybe its php? (3:45:06 PM) Neil Vallon: remove the where part again (3:45:29 PM) Dennis Kupec: did nothing (3:46:48 PM) Neil Vallon: semicolon at the end? im running out of ideas (3:47:15 PM) Dennis Kupec: lol no (3:47:22 PM) Dennis Kupec: im thinking its php (3:47:44 PM) Neil Vallon: try pasting it in phpmyadmin (3:48:19 PM) Dennis Kupec: UPDATE `serverlist` SET `players`=4, `maxplayers`=100, `status`=0; (3:48:21 PM) Dennis Kupec: that worked (3:48:43 PM) Neil Vallon: ... (3:49:17 PM) Neil Vallon: now paste that into the php as a string (3:50:08 PM) Dennis Kupec: worked (3:51:33 PM) Neil Vallon: now instead of using a plain string like "`players`=4," do "`players`=".4."," (3:51:42 PM) Neil Vallon: so it has to cast the int (3:51:53 PM) Dennis Kupec: k (3:52:58 PM) Neil Vallon: forget a dot? (3:53:05 PM) Dennis Kupec: no (3:53:29 PM) Dennis Kupec: idont see what i did wrong (3:53:36 PM) Neil Vallon: paste (3:53:49 PM) Dennis Kupec: "UPDATE `serverlist` SET `players`=".0.", `maxplayers`=".100.", `status`=0;"; (3:54:48 PM) Neil Vallon: fuck php... "UPDATE `serverlist` SET `players`=".(0).", `maxplayers`=".(100).", `status`=0;" (3:54:57 PM) Dennis Kupec: ... (3:55:03 PM) Neil Vallon: yeah (3:55:32 PM) Dennis Kupec: worked (3:56:11 PM) Neil Vallon: and you are dead ceritan that $result[3] and $result[4] are what you want them to be (3:56:48 PM) Dennis Kupec: ya (3:56:55 PM) Dennis Kupec: var dump shows that, so does an echo (3:57:12 PM) Neil Vallon: keep the parens and throw the $cp and $mxp back in i guess (3:58:26 PM) Dennis Kupec: guess what (3:58:42 PM) Neil Vallon: you've decided to learn bottle? (3:58:50 PM) Dennis Kupec: tempted but it didnt work (3:59:07 PM) Neil Vallon: https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/tumblr_m26nvnNG5o1qkk10ro1_500.jpg (3:59:29 PM) Dennis Kupec: god yes. ive never had a situation where that image fit it so well (4:00:39 PM) Neil Vallon: jesus fucking christ.. could i break up this problem any further? (4:00:50 PM) Dennis Kupec: i have no idea (4:00:55 PM) Neil Vallon: anything i have not covered (4:01:09 PM) Dennis Kupec: nope i dont think so. (4:01:28 PM) Neil Vallon: leave the var_dump($result) in there (4:03:00 PM) Dennis Kupec: done (4:05:19 PM) Neil Vallon: echo mysqli_error($con); (4:05:51 PM) Dennis Kupec: nothin (4:05:59 PM) Neil Vallon: I'm done (4:06:15 PM) Neil Vallon: http://bottlepy.org (4:06:39 PM) Dennis Kupec: ROFL (4:06:57 PM) Dennis Kupec: this conversation needs to be put on reddit (4:07:22 PM) Neil Vallon: thats fucking ridiculous (4:07:58 PM) Dennis Kupec: its php's fault (4:08:29 PM) Neil Vallon: Scientifically proven (4:10:10 PM) Dennis Kupec: http://pastebin.com/LVpuyQ6s (4:10:11 PM) Dennis Kupec: archived