Jump to content

Kays

Members
  • Posts

    64
  • Joined

  • Last visited

    Never

Everything posted by Kays

  1. When I need to, I will use it. I don't generally use it for scripting languages though. gdb and Eclipse are the ones I've used.
  2. INSERT INTO `final_list` ( SELECT * FROM `subscribers` S WHERE S.id NOT IN ( SELECT U.id FROM `unsubscribed` U ) ) Naming your table `final_list' is not very informative. Also, you may want to do a bit of research for INSERT ... SELECT before you blindly run the SQL above. And if you do, don't run that on a production system first time. Also, a LEFT JOIN work just as well and it is more efficient.
  3. Please address all of the following: 1. Post the Items class. Redact all sensitive information. If it is really long, post it on pastie.org and provide the link. 2. What's in require('includes/item-brains.php');? Redact all sensitive information. If it is really long, post it on pastie.org and provide the link. 3. What is the value of $_GET['listid']?
  4. If you could tell that, could you also narrow it down to 1 line? Libraries should be loaded in head. All else in end of body. The reason is that if you stuff all your scripts at the top, it can slow down page load times. Since the browser has to parse all of them before it gets to the important HTML that you want the user to see. So placing them at the end helps that. But libraries should to be at the top because you may want to call them anywhere within the page.
  5. It's easy. Just add a ON DUPLICATE KEY UPDATE to your INSERT. But you will need a unique identifier to the record in the DB. Otherwise, it wouldn't be a duplicate entry.
  6. It looks fine to me. You don't have to open and close all those PHP tags. Open one tag and put all your PHP code in between. If you are the ONLY person that would use that code, it's fine. However, if you have other users use it then: I will point out that you should RARELY trust your own input data to be secure. So please don't take on blind faith that the users won't try to break your system. So please secure your $_POST data before passing them on. Still, even if you are the only one using it, it's not a bad idea to secure them.
  7. judejitsu: if you want the information like "Start Station" then you may need to section your file into groups. Since your file has very little consistency, you may need to handle each one. Barand's code should work fine for those cases where you have a ':' in the search string. The rest are in a table-like format and it may not be quite as easy.
  8. You want to only update values that are modified right? If so, smoseley may have misunderstood. In that case, you'll have to check each field and update each one accordingly.
  9. Structure it using a MVC model. Since you are redesigning your site anyway.
  10. You'll need to utilize JavaScript for that.
  11. 1. A hidden input field next to each entry should work. 2. JOIN
  12. Yes, you're trying to include_once list.php twice. You had a /* (assuming you commented out), but you weren't in PHP mode and are in HTML mode. so that /* */ didn't really comment it out. You cannot comment out PHP from executing with <!-- HTML COMMENT --> so don't try it.
  13. Kays

    VC?

    Based on just what you have: 1. Better to name it class.* instead of *.class.php. 2. A controller shouldn't have a _getDBH() function. Makes more sense to have the model do whatever functionality you need. 3. Views shouldn't return a JSON encoded $data. Just display it on the spot. It can be pretty messy (and annoying) to look at any data that's in string format when you want to debug it later.
  14. Where is the sgid3.php? If that is the same file, then the answer is obvious. The information is being passed to the PHP file, but you're not doing anything with them. Have a read: http://devzone.zend.com/6/php-101-php-for-the-absolute-beginner/
  15. You can query for a mapping of: umpire -> game, count(home_game), count(visitor_game) So in a sense, you will get entries like: Umpire1, Game1, 50, 20 Umpire1, Game2, 0, 10 . . . Umpire2, Game1, 20, 0 . . . etc
  16. Although you probably shouldn't do that too much because all the loads may become annoying to some users, as well as possibly slowing down your site.
  17. Do you know what value is being passed here: xmlHttp.send(strURL);? Also, you're mixing up POST and GET. Your form is POST-ing data, yet your backend is GET-ing data. Weird. For all intent and purposes, please properly indent your code. And jQuery is always available if you find this too complex.
  18. Err... it's possible ... but why do you have 649 rows of that? I'm assuming that there are currently 649 number of Pokémon, but where did you get the HTML for all of them? Was there a generator?
  19. Why store it into $resultst? Just print it out as you would with $ttreasure. It can't possible be hard. You already done a very similar job some hours ago.
  20. Verify that $_GET['user_login'] is not empty.
  21. rick.emmet: yes you did. From what you showed us, you had 'head1' id on your checkbox element AND your form element.
  22. Okay no problem. The point is that XML by itself can't be sorted the way you want. So you have to use another medium (like an array). It's more annoying than it is difficult. 1. Delete everything you have below $approved = new SimpleXMLElement($xmlfile);; 2. Create an array, let's say: $results = array(); 3. Loop through $approved as you already had it: foreach ($approved as $approve) 4. Now for each $approve, store its data in $results. Preferably just the data you need, but to keep this simple, just add the whole $approve to $results as so: $results[] = $approve; 5. Finally, loop through the $results array, but in reverse order: foreach (array_reverse($results) as $result). Inside this for loop, you want put those echo statements that you had. Does that help?
  23. Oh oops. Yeah, you are missing parts of code there. After you parsed the XML, loop through and store them into array instead of echo-ing it out. Then loop the array to print it out.
  24. foreach (array_reverse($approved) as $approve)
×
×
  • 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.