Jump to content

Wiro Blangkon

Newly Registered
  • Posts

    13
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Wiro Blangkon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Which IDE are you using? Look for a missing ";" or ")" just before line 153.
  2. Hi Proteus, These are also useful: http://php.net/manual/en/function.json-encode.php http://php.net/manual/en/function.json-decode.php http://nl2.php.net/manual/en/function.explode.php http://nl2.php.net/manual/en/function.implode.php Wiro.
  3. Hmmm, not sure how sub-subdomains should be set up, but it may be possible that you have to explicitly make an A record for ftp.sub.domain.com .
  4. The code says that if $dir is a file (not a folder), all the XML files contained in it should be stored in the DB. That of course is not possible. Wiro.
  5. Hey Dom, If you ping to both domains, do you get the correct IP addresses as response? It could be simply the case that it takes a little bit longer for the DNS settings to your subdomain to take effect. Best regards, Wiro.
  6. Hey MX, The jizzt of recursion is that a function does a call on itself. In your function, I see function X calling function Y, but it should call function X again, although with different parameters. Think of your complex directories as a tree, and that every call to your function puts you at a junction in the tree. Best regards, Wiro.
  7. Do drop a note to let us know about your progress.
  8. Hello MX, 1) You might want to do your msyql_connect only once, before you start your recursive function. 2) Do you have a particular reason for $_filePath = $curFile ? 3) My suggestion for the recursive algorithm in pseudocode: function storeXMLfiles($root_dir) { // TODO: get $root_dir contents and put them in an array called $contents foreach ($contents as $content) { if (is_dir($root_dir.'/'.$content) { storeXMLfiles($root_dir.'/'.$content); } else { // TODO: Do your XML storing magic here } } } Good luck with it. Wiro.
  9. You can leave out the GROUP BY and do a simple SELECT with ORDER BY OrderID. Then PHP loop throught the records, printing out every OrderID once if it is different from the one in the previous record.
  10. Hello Slarti, Good to know you appreciate my questions. You can protect yourself from a lot of time in re-programming, undoing previous work, if you know what your goal is and how to get there. Since you're saying you are making your first steps in PHP and MySQL, I'd say: keep things as simple, plain and straightforward as possible. You can think about optimization of speed, memory and sheer beauty of code once you feel you're ready for it. Storing a rate for each day of the year sounds inefficient storage to me, but if there's a maximum of 366 rates in the rate table, that would be no problem. Besides, if the rates are stored as a simple, 366-record table, extraction of rates for each renting agreement would be a simple matter of selecting which rates are used. Here's some food for thought: SELECT ac.agreement_id, SUM(r.rate) AS total_cost FROM agreements_costs ac INNER JOIN ac.rate_id=r.id WHERE ac.agreement_id=<enter your agreement id here> Good luck! Wiro Blangkon.
  11. $query = "SELECT cost_1, cost_2, cost_3, cost_4, cost_5, cost_6 FROM cost_$thisyear WHERE date_strtotime IN( '$date_1','$date_2','$date_3','$date_4','$date_5','$date_6','$date_7','$date_8','$date_9')"; Being a person that produces structure in other people's lives within a time limit, I'm a big fan of straightforward and manageable designs. That said: the purpose of your raw costs table is to keep the raw costs. If you want to give some special status to some costs, for example hire seasonly costs, you can create a table that combines the hire seasons with the cost ids. That latter table would have a different purpose from your raw cost table, namely adding a special status to your raw costs and most likely make it easier to get the costs given a specific hire season. Is it very important that the weekly costs per hire season (or do you mean AVERAGE weekly costs per hire season?) are extracted purely with MySQL? You would make your life easier by first extracting the weekly costs from the raw costs with a MySQL query, and then extracting the weekly costs per hire season with PHP: raw costs (table) >>> weekly costs (MySQL query) >>> hire season costs (PHP) Please let us know if you need help with the query or the implementation. Best regards, Wiro Blangkon.
  12. SELECT <fields you need> FROM ORDER WHERE ORDER.id=<ORDER ID HERE> or SELECT <fields you need> FROM ORDER LEFT JOIN ORDER.id=PRODUCT.OrderID That would be the core of what you need. Furthermore, you might want to consider using INTs as your Order ID instead of Strings. INTs have handy things with them, such as AUTO_INCREMENT. Don't know if you can do indexing with Strings, I think not. Good luck! Wiro Blangkon.
  13. Hello Keevitaja, Can you (1) show us the join you use and (2) tell us in simple, non-MySQL, English what information you want to retrieve from the database? Wiro Blangkon.
  14. That being said, I'd like to say that I like people who tend to behave in a helpful manner, no matter the level of expertise.
  15. Hi all, This is my short introduction. I've been a professional web developer for over 2 years now, mostly in PHP, Javascript and the ExtJS framework. I did some loops and switch-cases in Turbo Pascal when I was twelve. At the university, I learned C++, some Java, Lisp and MatLab. I also like to tinker around in the Android SDK. For the most part, I hope I can exchange helpful advice on this forum, partly by extending my own knowledge to others and partly by asking other people nicely. So here I am. Wiro Blangkon.
×
×
  • 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.