Jump to content

objnoob

Members
  • Posts

    327
  • Joined

  • Last visited

  • Days Won

    3

objnoob last won the day on December 4 2013

objnoob had the most liked content!

Profile Information

  • Gender
    Not Telling

objnoob's Achievements

Member

Member (2/5)

8

Reputation

  1. Wouldn't it be easier to pay me since you've found it too hard to Google anything thus far?
  2. nope, you just accept the request and after validating the user permissions initiate the cgi script.
  3. I do. file_get_contents to open the url and retrieve data preg_match_all and a regular expression could do the trick for extracting the data simplexml for writing output
  4. DOM and SimpleXML are two PHP extensions one could use to read/write HTML, xHTML, XML and xHTML, XML respectively.
  5. Yup, protect it with Apache. Only allow 127.0.0.1 (localhost) to access it.
  6. probably because you have two columns with the same name cat.category_name, parent.category_name You should give one an alias using the AS keyword: SELECT cat.category_id, cat.category_name, cat.category_parent, parent.category_name AS parent_category_name FROM .... You'll then have both $data['category_name'] and $data['parent_category_name'] to work with.
  7. i understand now. thanks
  8. And, this didn't peak your interest at all?-- because it's pretty badass and really what you should have wanted to learn! It makes useful use of your users' computer power and saves your server from doing extra stuff it really doesn't need. It also reduces the overall size of the transfer! Stop polluting the internet, thanks! ;] <style> .storm { background-color: black; color: #FFF; border: 1px #666 solid; text-align: center; font-size: .9em; } .storm.weak { color: rgb(255, 255, 0); } .storm.strong { color: rgb(255, 0, 0); } </style> <?php echo '<td class="storm ' . $tintensity . '">' . $tintensity . '<td>';
  9. You shouldn't store calculated data. Unless the data changes infrequently and used VERY OFTEN and the calculations are derived from a VERY LARGE data set and take 5 minutes to produce. When you store calculations, you need mechanisms to ensure the stored value is in fact the correct value. When the data changes you need to update all of these balances columns and that is room for disaster. You should be calculating balances on the fly. Take max subtract used and you have a balance. There is no way your data set is going to be large enough to warrant storing derived data. Make sure to get your indices set up and make sure you're using them properly when joining / querying data. Learn how to read the output of MySQLs explain query feature. Don't store a request off that spans multiple days in one row. At most the request off should be a single date and time from / to. date | time_from | time_to ------------------------------------ 2013-01-01 | 00:00:00 | 23:59:59 = 24 HOURS the entire day. You can check if it's a holiday by looking the date up in the holidays table. if you don't need to be exact on from & to, you can just store how many hours as a single column. You don't have to have an extra table to map the request off record with the holiday record- The of the request off date should be enough to map it to any holiday. You don't need an ID column in the holidays table. The date column is the primary key / ID
  10. it's very [programmer] human-readable for me too! when working with large schemas and large data sets, i've found it's more productive to work outside of php. This format is the most useful to me and easily sortable by eye. after all, it wasn't an accident the Y-m-d H:i:s became the format.
  11. $query = 'SELECT * FROM a_playerRank WHERE CONCAT(nameFirst," ",nameLast) = \'' . $slug . '\''; or better yet.... $query = "SELECT * FROM a_playerRank WHERE CONCAT_WS(' ', nameFirst, nameLast) = '{$slug}'"; Line 14 is.... while($line = mysql_fetch_assoc($results)) {
  12. I mean the word outer is optional, but the effect is the same.
  13. Heh, I failed to notice this. Good catch.
  14. Better yet.... You can define classes, then you wont have to switch() shit. <style> .storm.weak { color: rgb(255, 255, 0); } .storm.strong { color: rgb(255, 0, 0); } </style> <?php echo '<td class="storm ' . $tintensity . '">' . $tintensity . '<td>';
  15. You need to put that CSS inside the style attribute. echo '<td style="color: ' . $stormIntensity[$k] . '">' . $tintensity . '<td>'
×
×
  • 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.