Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Oh, you don't want just the one result? You want all of them? SELECT * FROM table WHERE ddate I'd really have expected you to try that by now, though.
  2. You only need the first URL to have that query string - it tells XDebug to begin the debugging session. If you lose the query string after, that's fine (and it's expected) and your debugging session will continue. So jump between pages to your heart's content.
  3. Did you look at the query I wrote? I don't think you did, because if you had then you would know it only returns one result. And if it wasn't clear, there is a bit in the middle you need to do by yourself.
  4. If you moved done, valid, and file into the visitas table then rel_visitas_utilizador would not be needed anymore.
  5. Okay, so it's a 1-1 relationship then. Since there are only a couple columns in that table, and you know that those columns will have values, I would move them into the visitas table. It's not an important change to make, but it does reduce complexity. And I think that is the only change I would make.
  6. If you think about it that way, it's straightforward: find all the rows that aren't too far into the future, sort them by the date in descending order (latest first), and pick the first one. SELECT whatever FROM table WHERE date is no more than 3 days in the future ORDER BY date DESC LIMIT 1
  7. Right, but if your question is what to do regarding the schema, then first you need to understand the application. I see that it's 1-N now but I'm wondering whether that is the correct relationship.
  8. What you described sounds like the teacher creates a study visit (new row in visitas) for every time they want a study visit. This one visitas row then gets a rel_visitas_utilizador row for approval by a manager. Does that mean there is a one-to-one relationship between visitas and rel_visitas_utilizador? One row in each table matches up with only one row in the other.
  9. So would it be accurate to describe that as wanting the latest date you have available that is no more than 3 days in the future?
  10. That's not really a "handshake". Like in real life, handshakes are used after the initial connection is made to identify both sides to each other and make sure they're all speaking the same language. For you, a handshake would do something like exchange protocol versions to negotiate which one to use - client supports 1,2,3, server supports 2,3,4, best version is 3. Speaking of, protocol is what you're looking at here. This version of the protocol - Exchanges JSON - Sends a request in the form {jsonrpc: 2, method: string, params: {...}, id: identifier} - Sends a response in the form {jsonrpc: 2, result: whatever, id: same identifier} Assuming it fulfills the needs of the application (eg, params being a keyed object instead of an array is up to you) that's a reasonable protocol. "Requirement"? "Protocol" may be the term you're looking for. It varies based on the application, transmission medium, data requirements... What you have there is actually like a JSON version of SOAP. Server making the connection doesn't make sense with your description. The client connects to the server to perform a task, great. The server connects to the client to... what?
  11. Do you have both of those RewriteRules running at the same time? Which one is listed first? And "doesn't work" is meaningless. Means nothing. Unhelpful. How does it not work?
  12. Notices and warnings are not fatal, but if you turn them into exceptions then they won't be. Go ahead and do that if you want in a development environment in order to find potential bugs, but don't do it in production - you don't want some random fluke somewhere to take down your site.
  13. That URL would rewrite to /index.php?Page=bale&baleId=6&CategoryId=2If you try that yourself does it work?
  14. Forget about max for this. Think about what would happen if you joined the table against itself and with the condition that the second table's rows have a higher salary than the first table's...
  15. It means somewhere you did an unbuffered query and didn't read all of the rows and/or didn't ->close the statement. It was probably earlier in your code. Switch to buffered queries, which won't have that problem and are generally better for everyone involved. [edit] 2 minutes.
  16. Each logical page should have one controller. Each controller can have zero views (if it doesn't need to display anything, like if it redirects) or one view (it displays something) or multiple views (if the page is basically the same but can be displayed differently). Models are tied to data. If you're using models for page data (eg, forms) then you have a model for each form, but otherwise models are not related to controllers. Most people just have models for their database entities, and controllers use the models to do whatever they need to do. Models don't handle requests. Controllers handle requests. Before you continue, learn what MVC actually is. Here's one of the first results I found for "php mvc" on Google: The MVC Pattern and PHP, Part 1.
  17. If simply opening the file was enough then there's a good chance your Office isn't up to date with patches: the file should have been blocked by Word from doing anything, specifically for this reason. But yeah, lesson learned. Companies do not send attachments with emails, not least because of the processing overhead to do so - they either tell you what you need to know in the email, or link(/phish) you to a website.
  18. The mailing happens in print_result, which happens if $_REQUEST["result"] is set. It won't trigger on the same request with the one that does the redirect (which, by the way, should have an exit; after the header() so that your script stops doing any more processing). Take a look at your web server's access logs to see if that page is being loaded more than howevermany times it should be - which sounds like two.
  19. It's pretty much guaranteed to be malicious, and it's likely not the only bad thing that got added to your computer.
  20. Sounds like the page might be being loaded twice. Any ideas how that could happen?
  21. Apparently your regex didn't match. Do you think that maybe your next step should be to see what's in $duration? (The first value it gets, to be specific.)
  22. Do var_dump($matches);to see what $matches actually looks like.
  23. 32-bit Linux is also dead. Why not use 64-bit? And I'm not familiar with Vagrant but can't you just build your own image?
  24. Anyone want to mention nested sets?
  25. There is no correct code replacement to make because that's not the problem. Upgrade your VM. Ubuntu Precise is more than four years old, and PHP 5.3 is not just dead and buried but completely decomposed.
×
×
  • 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.