Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Wordpress stores its content in a mysql database so you can use whatever you would like to access it. It seems like a pretty daft idea. If you want to use Wordpress as your back end it seems logical that you should be using Wordpress themes fro the front end. It will be much less work in the long runas its already designed to work with there data structure. Which buy the way are fucking terrible. If your really thinking about accessing Wordpress's data yourself, just drop Wordpress all together. You gain nothing but a nice backend interface.
  2. That is better done with javascript. Just make new elements named aine[] and ope[] (not that one mistake you currently have already is that id's in html must be unique). This will create an array of form fields which you can then simply loop through in php.
  3. Looks like its working to me. Whats the issue now?
  4. We are going to need a much clearer explanation.
  5. No kidding. mysql_num_rows returns the number of rows contained within a result resource and expects to be passed a result resource. Your result resource is in $jobsc_result but that won't help you. What your trying to do is find the size of a simple array. Replace mysql_num_rows() with count(). And please, turn error reporting on when writing code!!!
  6. Of course its possible. Where exactly are you stuck?
  7. Looks like Photograph::find_all() returns an array of objects.
  8. Thats just due to poor coding. You never actually check the results returned from the mail function before displaying some "success" message.
  9. The easiest solution to this issue is to disable the tty requirement within /etc/sudoers Defaults requiretty
  10. No. You can configure sudo to not require passwords if need be, even locked down to specific commands as well. Surely you can configure what script is executed? Even still, you could easily enough create this simple wrapper using PHP instead of Bash if need be.
  11. Your asking for a critique? Sorry, but it looks terrible.
  12. http://php.net/gd
  13. It would be easy enough to wrap your script in a simple bash script to execute it via sudo. Tampering with the shebang line won't help. #!/bin/bash sudo -u someuser /path/to/your/phpscript.php
  14. Says you. Where exactly is your proof?
  15. Git is awesome! I hate it when I have to use any other VCS.
  16. Cool. Fancy marking your thread resolved then?
  17. The technology your looking for is called websockets. http alone is stateless, and there is no such thing as keeping a connection alive. I believe there are a few libraries around for php which handle this. Ive not used any though. Ratchet is the first result I found on Github. https://github.com/cboden/Ratchet
  18. The only time you would get the string "false" is if your data was the string "false". If you store your booleans as 1's and 0's (in a tinyint(1) field) they will equate to true and false in php.
  19. Or, do as has already been suggested and use a shebang as other scripts on Unix do.
  20. Can we see some examples of your data?
  21. The two ideas are both valid. Generally though, you would fall only through to an auto resolving mechanism if nothing was setup within a controller manually. As for your header / footer issue. It's easy enough to implement inheritance within templating. You will find most modern php template engines already do so. This enables you to extend one template with another at the template level.
  22. I still don't understand what the OP is getting at. Just letting him know what can be done.
  23. The second argument to mysql_result is the row. Your giving it 0 over and over again. Your not using $i anywhere. Having said that, why are you using mysql_result at all? The documentation clearly states: On top of that, the mysql extension has been deprecated. Any new code should be written using PDO or MySQLi instead.
  24. You can have as many ORDER BY clauses as you need, separated by comas.
×
×
  • 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.