Jump to content

vinny42

Members
  • Posts

    411
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by vinny42

  1. Bots can understand questions if they are simple enough, like "How much is 2+2?" But I can't imagine that phpbb doesn't have captcha plugins?
  2. Good to hear. However I would advise you to look at array_intersect() too, if that does what you need it is certainly much more efficient than looping with array_search().
  3. If the application is to filter records then yes, the database will win. The reason is that databases can use indexes to very quickly filter out records that have no chance of making it to the final set. Think of a telephony directory; if you are looking for the phonenumber of a person who'se name begins with the letter 'H', you can skip all the pages a-g and once you have looked through al he 'H' you can stop because app the pages after tht won't contain any more names starting with 'H'. The database also knows statistics about how many records there are for each of the indexes so it can work out which filters to applu in which order so that a few records as possible have to be processed. Alltogether you'd have to have one flipping fast PHP routine if you can process all the records in what is basically one big sequential scan, faster than the database can eliminate records by not even looking at them. Perhaps it's wise to post an example of the sort of data you have and the type of filtering that you want to do.
  4. Are you using an IMG tag to call the image, and is does the script that fetches the image send the apripriate headers?
  5. Check your coordinates. The destination coordinates in the new image should be 0,0 to place the pasting action at the top-left corner.
  6. Run the code yourself, it prints 0 1 2... If the only change is the names of the vars then the names of the varsin your real code are probably wrong.
  7. Post the error... if you want us to help you with it...
  8. The code you posted contains two syntax errors but is otherwise fine. So, what does your real code look like?
  9. The only things that are going to stop running process PHP is are a kill command and an apache restart. You cannot restart apache unless you are root (and if you were root you would not be asking how to stop a process). You can stry a kill command through a system() call, but if it's not your own private server and if the server is not setup very bady, you will simply not be able to do that. Remember, everything is built and designed to prevent hackers and bugs from stopping processes arbitrarily....
  10. Dunno, you are still not posting the only bit of code that I want to see :-) You are using $data['img_blob'], but how to you fill $data? Where does the content of img_blob come from? You prepare the $st variable but you don't show that you execute the statement and how you catch the errors it might return.
  11. Darn, I missed that. I seem to be missing alot the last couple of days. Well in that case just grab the value of the 'type' field and use it as an index in the count array: $counts = array('foo'=>0,'bar'=>0,'wibble'=>0); // loop $count[$value_from_json] += 1; and at the end: var_dump($count);
  12. Ok, so what does PHP say? Does the execute command return an error, or does the bind statement return false? What kind of error checking are you ding there?
  13. Then surely it must give an error, which is why I wanted to know how tou check the query for errors. Is it even possible to load binary data into the database like that? Shouldn't it be encoded i some way? Most databaes have separate functions for storing blobs (because they can give performance problems).
  14. Where and how do you check that the query has been executed correctly? And why do you stiore images inside the database, that's generally not very good for performance when displaying the images.
  15. Normally I'd advice very strongly to log each vote separately. not only because you can get much more interesing data from it, but also because you can record who has voted and prevent them fro voting more than once. But, if that doesn't matter then I'd second requinix: count only the totals. To answer the question itself: What does your JSON really look like? I dont think it's just what you posted because that's not valid json.
  16. hmm.... I missed it before. The escape-string function requires that you are connected to the database and you are caling clean() before you connect.
  17. Did you google the error? Because it is pretty self explanatory; you are looking for an element of an array and that element does not exist.
  18. Do you mean that $post contains a boolean value?
  19. I'm getting a deja-vu here, checking lots of servers every ten minutes... The only way to know if a service is running is to connect to it and if you read the manual for fsockopen you'll see that you can open blocking and non-blocking connections. Blockin connections (the default setting) will wait for the socket operation to complete before you can go on to the next, non-blocking operations return immediately and it's up to you to check the status regularly. Thus you can open connection 1, and immediately open connection 2 without having to waitfor connection 1 to respond. After you have opend all your connections you can start looking at their status. All connections can run at the same time.
  20. Get a life barand, please. I answered the ops question, you just post so complain. Grow up.
  21. Sigh. Whatever. I'm done arguing with you.
  22. That depends very much on how you connect to the server, and also, who cares if the sender is down, if the message has been queued it will be sent at some point. Actually no, the queue really doesnt care if you wait or not.
  23. I'm guessing the real question is how to make a trigger excute PHP code. You can't. MySQL only support's it's own language. Other databses like PostgreSQL could run a shell script or call a URL to trigger some action (provided that performance allows for it) but in MySQL you're stuck.
  24. So you select all records from the database and loop through them to see which match the criteria. Why don't you just build a query that get's only the records that meet the criteria? What kind of criteria d you have?
×
×
  • 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.