Jump to content

requinix

Administrators
  • Posts

    15,289
  • Joined

  • Last visited

  • Days Won

    436

Everything posted by requinix

  1. I moved the title: it used to be above the avatar, now it's below. Sometimes there's confusion about the title looking like the name (when it's actually in the bar above the post) so maybe this little change will help with that. For future reference: global templates > userInfoPane
  2. I'm going to ignore the SQL injection and go for the question itself. In a case like this I would do a GROUP BY + HAVING COUNT SELECT id FROM fruit WHERE fruit_name IN ("apple", "banana", "orange") GROUP BY id HAVING COUNT(1) = 3Make sure the id + fruit_name pair is unique, even if the two aren't individually.
  3. Another suggestion is to break the dates into separate date and time components. That makes matching up dates and reservations more efficient as you won't need to DATE() anything. The basic approach to the query is to start with the table you want data from (dates) then use a JOIN on another source (reservations) to filter out records you don't want. SELECT d.date, d.time, r.count FROM date table AS d JOIN ( SELECT date, COUNT(1) AS count FROM reservations GROUP BY date HAVING count < 80 ) AS r ON d.date = r.date ORDER BY d.date, d.time The filtering (count
  4. The name of the node is just "Fee". The rest of it is an attribute of the node.
  5. So SUM(number of reservations) GROUP BY DATE(date) Given what you said above, why do the times matter? Do they not matter, and in this example where the date only has two times you're just mentioning them with the date? One possible improvement would be to relate reservations to date IDs, not to the dates themselves. Reservation# | Date ABC123 | 1 ABC456 | 1 ABC667 | 1 ABC777 | 2 etc | etcIt could help with the JOINs or subqueries you will inevitably do.
  6. We can't just give you the code - you wouldn't be learning PHP if we did. But we'll help you write it. What have you done so far?
  7. If you want basic help then you have to post some basic information so we can have a basic idea to what sort of basic assistance we should provide. Basically.
  8. You've managed to copy the code from the fgetcsv documentation so you have that much working correctly. Next step is to write the code that does the "search" according to the values in $data: if the value matches then do whatever, if not then don't do whatever.
  9. It seems a bit silly but I'd still do the two conversions: I object to piecing the JSON together by hand on principle, and decoding the strings doesn't take that much code. $a1 = [ ['x' => 321, 'y' => '{"a":5,"b":"hello"}'], ['x' => 321, 'y' => '{"a":2,"c":"goodby"}'], ['x' => 321, 'y' => '{"a":5,"b":"hi","d":"please"}'] ]; $a2 = ['foo' => 123, 'a1' => $a1]; array_walk($a2['a1'], function(&$v) { $v['y'] = json_decode($v['y']); }); echo json_encode($a2);
  10. I don't know what that /P.P/ thing is supposed to be because it doesn't look like anything close to what you need to use. Be more specific about the membership number. What is the exact format? What are valid examples and why are they valid, then what are some invalid examples and why are they invalid?
  11. Showing us a screenshot of a broken image doesn't really accomplish anything. You've managed to post a small snippet of PHP code demonstrating your image swapping technique, and an example of what kind of BBCode you want to enter into a... whatever you're entering it into. How about posting the code involved in turning that BBCode into HTML markup? And while you're in there, how about giving more detail about that broken image; what URL it has for the src would be a great start.
  12. If you can read it as a CSV then you can get it as an array, with either fgetcsv or str_getcsv depending. Then all you need is a foreach loop.
  13. What have you tried and how did it not work?
  14. Turns out to be a user group restriction that applies to new users. I've moved you to the regular member group - check that one page again.
  15. Then what does it display? Comment out the header() - do you see any error messages?
  16. The best thing is for you to remove the information you don't like (or all of it) from your profile. The settings are over here.
  17. Use the query string: construct your URLs to look like specialprice.php?cardcode=CM000001-Mby doing In specialprice.php you can access the value with $_GET['cardcode']. But don't put it directly into your SQL because anyone could put whatever they wanted into the URL for the "cardcode" and mess up your SQL, your data, and your entire database if they wanted. Instead use prepared statements in place of sqlsrv_query.
  18. Fair point. Then instead $("#payment input:not(:hidden)").serialize()
  19. You can make things easier on yourself by just sending the entire .serialize()d form instead of picking and choosing which fields to include. If you do, make sure to update your PHP because the amount will be called "x_my_amount".
  20. It looks like you're using Javascript (that "prepareForm" bit) to process the form before it gets submitted. That's how the data is being passed to your PHP. So. What's the code for prepareForm? When it constructs the AJAX request to send to your code, does it include the new fields you added?
  21. What's the code that POSTs the data to this page? Because that's where the problem is.
  22. Does the browser show any requests to any pages that aren't HTTPS? Do you have any custom code in place for the upload form, the upload process, or logging in?
  23. Use your browser's "developer tools" or whatever to look at the HTTP request made when uploading the file. Does the browser include a Cookie header with the request that matches the session cookie?
  24. Is the upload page on an HTTPS URL? Is the action of the upload form using an HTTPS URL?
  25. There was a specific part of the docs I wanted you to see, but apparently it's in a user comment and not part of the official documentation:
×
×
  • 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.