Jump to content

btherl

Staff Alumni
  • Posts

    3,893
  • Joined

  • Last visited

Everything posted by btherl

  1. If I understand you correctly, you would look at adjacent chunks if they are within the viewable area. I can't really give a more detailed answer than that as there's not much detail of your implementation in the question.
  2. If I understand you correctly, what you can do is this: SELECT * FROM ( SELECT ... ) UNION ( SELECT ... ) UNION ( SELECT ... ) This will give you the unique results from all of the subqueries. It depends what you mean by "join" though - usually a join in SQL means to match up results based on common data, such as "same name" or "same id number", and put the matching data in the same result row. Your question sounds like you want to combine the result sets using "union", which basically means "Get these results, and these results, and these results, and return them all".
  3. I don't see anything wrong with how you are calling the service. At this stage I would follow one of two approaches: 1. Just use __getLastResponse() and forget about $result 2. Look at the soap client library and see where the XML is getting stripped. Mine can be found here: /usr/share/php/SOAP/Client.php. I'm also curious why there is no xml header on __getLastResponse() - shouldn't there be one? Can you confirm for me that you're looking at the raw output of print_r(), and not viewing it in a web browser which is trying to render it as HTML? I'm asking because trying to display XML as HTML usually gives you the data without the tags.
  4. What are you trying to test there? Do you want to see if there is any text in $_POST['organogram']? That it's not empty?
  5. Diff is line oriented, but you can just as well use a word as your basic unit instead of a line, and apply the same algorithm.
  6. A good start might be here: http://en.wikipedia.org/wiki/Diff
  7. I don't see any mime headers here. Try setting the headers according to this example: http://pear.php.net/manual/en/package.mail.mail-mime.example.php
  8. You should be contacting the vendor for support, since this is a commercial package.
  9. If you negotiate an SSL connection with the bank's server, then you know the following: 1. You have negotiated the connection with the bank and not someone else (this is based on checking the SSL cert from the bank) 2. Only you and the bank know how the data is encrypted. It doesn't really matter how many other servers the data goes through to get there because only you and the bank know how that data is encrypted. So if your client also sends the data to you by SSL, there are 3 points at which the data is unencrypted - the client's computer, your server and the bank's server. The other servers inbetween just get encrypted data. Is that what you're asking about?
  10. If you want to see the result for debugging: print htmlentities($result); Or you may need to display some element from $result if that XML is not at the top level. If you want to use the result in your code, you will need to use an XML parser. Is it possible the server is sending XML encapsulated in SOAP? So the SOAP library has already stripped all the SOAP container, and what you're left with is the data, which also happens to be XML itself?
  11. If you google for "php form tutorial" and "php mysql tuturial" you will find many. I suggest you open up several of them, read through a bit of them and choose one that you like the style of.
  12. What happened when you tried the queries I posted earlier?
  13. Yes that makes sense. What you should do is find two types of tutorials and complete them: 1. A tutorial on validating form data in PHP 2. A tutorial on using MySQL from PHP Once you experience with those two topics, you will be able to do what you want.
  14. That makes sense.. it sounds like all you need to do is check who needs an email sent to them and send it? How to do that depends on what your rules are for sending emails and where those rules are stored..
  15. You need to skip the first lines for that to work. That means you need a different variable to remember which line you are on, AND the start line and end line. You would skip lines while $i <= $ic, then print lines while $i <= $ic_max.
  16. What do you mean by "trigger"? What kind of conditions trigger the email? For #4, you can check the data before submitting. For example: $validate_failed = false; $validate_message = ''; if (trim($_POST['username']) == '') { $validate_failed = true; $validate_message .= "Username is missing<br>"; } And so on for each variable that is required to be non-empty. At the end of the validation you check if $validate_failed is true - if it is, then you display the message and the form again. If it's false, then you submit the data to the database. If you want you can do stricter checks, such as "username must contain letters and numbers only". You could also do the validation in javascript before submission, which is more user friendly.
  17. I'm not sure if I understand you correctly but are you looking for this: SELECT p.product FROM products p WHERE p.category = 'retail' AND p.subcategory = 'none' Plus you want the subcategories listed: SELECT c.subcategory FROM categories c WHERE c.category = 'retail' AND c.subcategory != 'none'
  18. Like! I was going to suggest this myself. While it's nice to have conversations it is also messy. like works on facebook and on other forums (sometimes called thanks), and it can work here. In particular I would like to be able to notice a good reply to someone's question and like it, so other people can see it's been liked by a guru without me having to post saying "Yeh that's pretty accurate", which makes me feel like an attention whore and wastes quite a bit of screen space for people reading through the topic. Of course someone has to implement it Edit: Adding like doesn't mean we can't still have conversations.. and people still have conversations on facebook. It's an extra option, not a directive not to talk anymore It's an option for when you don't feel like saying something but still want to show interest.
  19. Yes you would use a join for this. Are the values really in mixed case (sometimes "Retail", sometimes "retail") as you have there in your question? If they are then that'll be a problem, but I'll assume they aren't. SELECT p.product, p.category, p.subcategory FROM products p JOIN categories c ON (c.category = p.category AND c.subcategory = p.subcategory) That is a standard join on two columns. The results will include data from both tables, but only where both those columns match. One thing I don't get - if you only want product, category and subcategory, these are all in the products table already. There is no need to join with categories table unless you need additional data from the categories table.
  20. In summary, no it can't be done If you can describe the problem you are trying to solve we may be able to suggest an alternative solution.
  21. Can you post a short script demonstrating that it doesn't work? Something like this: <?php $str = "<br />"; function br2nl($string) { return str_replace('<br />', "\n", $string); } print "Before: " . urlencode($str) . "\n"; $str = br2nl($str); print "After: " . urlencode($str) . "\n"; ?> The urlencode() is there so you can see any hidden characters.
  22. Try printing out your string before br2nl() and after br2nl(), to see what is going wrong.
  23. Are you going to fetch the entire file and then find rows x to y? Or do you want to fetch only rows x to y?
  24. The first de-monstrifying step is to make your indentation consistent. Choose a rule and stick to it. The second is to seperate logic (php code) from display (html/javascript). Instead of echoing javascript directly from your code, you can set a variable like "$vote_recorded = true". Then your code becomes neater, and you can display the actual HTML / Javascript later by checking if $vote_recorded is true. Those two steps will give you much neater code. Neater code is easier to understand and easier to get to do what you want.
×
×
  • 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.