Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. You haven't checked your query succeeds or returned any results. $query = "SELECT * FROM calculator WHERE Abbreviation = '" . $_GET['abbreviation'] . "'"; if ($result = mysql_query($query, $con)) { if (mysql_num_rows($result)) { while($row = mysql_fetch_array($result)) { //some code... } } else { // no results found } } else { // query failed }
  2. #1 is by far the better option because of its flexibility. Surely the userID's are numbers though?
  3. Format the date in your actual query. http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format
  4. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=319683.0
  5. This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=319682.0
  6. Can we see your actual query. The bit you have posted is probably a little out of context.
  7. jQuery is just a Javascript framework. It makes programming Javascript easier. Take a look at how you do Ajax requests with jQuery here: http://api.jquery.com/jQuery.ajax/
  8. Variables are not interpolated within single quotes.
  9. The .htaccess file is a server config file. So you are letting the server handle it already. If your application is noticeably slow your likely doing something wrong somewhere or over complicating things. The MVC pattern lends itself very well to web applications, hence it's popularity. I've written a couple of frameworks in my time (all have since been superseded by the next and I'm currently in the process of again another complete rewrite) but have never had any issues with speed. Most of my issues are maintainability, but that's just because I can have a tendency to over complicate things. Try and keep your design as simple as possible (KISS).
  10. Do you know what Ajax is? Your question is like asking "Should I drive to the store or take the car?" jQuery is a tool which can be used (amongst other things) to write Ajax. Ajax is simply a methodology, it is not a technology in itself. Now, onto your question. Yes, you are going to need to use Ajax here unless you want the whole page to refresh every time new data is requested. I would use jQuery to do this, but that is only because it is my preferred library. There are many others around, and it could also be achieved quite simply using pure Javascript.
  11. Are you sure? A redirect would be time consuming, but that's not the typical method. Typically you just tell the server to pass all requests to an index.php file. This costs no time at all. Routing can be an expensive operation in most MVC's that I've seen. This really is the part of the application that needs allot of optimization, and youv'e just got to be careful how you go about things. We would need to see some relevant code before we could understand exactly how your routing works and be able to offer much assistance. Though there are a few pointers we can probably through at you. Avoid routing via regex where possible. If you don't need to match a pattern, and can simply match a static url to a controller / action, then do so. Put your simplest routes first. This way you don't have to waste time processing the more complex ones unless they are needed. That's probably all I could offer without seeing your code.
  12. The errors where always there, you just can't see them when you have error reporting set lower. It doesn't mean there not effecting performance though, errors are errors and php has to go out of its way to work around them. It's a sign of poor code is all. Code should be developed with error reporting set as strictly as possible, that way the dev will see and fix the errors straight away. These errors don't likely have anything to do with your actual problem, it's just something else that should be fixed.
  13. Your comparing the database record to what appears to be an undefined constant nl. You need to turn error reporting to E_ALL and set display errors to on when developing. If nl is meant to be a string it needs to be surrounded by quotes. if($row['lang'] == 'nl') It might not be causing your issue but it's a pretty good sign of poor code. Is this code your or some third party?
  14. Nope. On this line.... if($row['lang'] == nl) You use the constant nl, where is this defined?
  15. Are the constants nl, en and de defined anywhere?
  16. If your looking for someone to write code for you we have a freelance board. read the stickies within that board before posting. http://www.phpfreaks.com/forums/php-freelancing/
  17. You really should look at moving allot of those queries into one. Your code is ridiculously inefficient.
  18. This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=319617.0
  19. Did you read the.... part?
  20. Doesn't look like any php issue to me.
  21. http://php.net/manual/en/datetime.diff.php
  22. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=319614.0
  23. mysql_query("INSERT INTO partsused (ptnumber, partqty, partdesc, partprice) VALUES ($ticket, '$partsusedqty$i', '$partsuseddesc$i', '$partsusedprice$i')");
  24. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=319610.0
×
×
  • 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.