Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html#function_in
  2. Read the error message, it tells you where the output is occurring at that is preventing the header() redirect from working. You must find and fix whatever is causing that output.
  3. If you saved the file as a UTF-8 encoded file without the BOM characters, it should have worked. You would need to attach the resulting file to a post so that someone could determine if the problem is with the file or somewhere else. Best guess is that your editor does not correctly handle saving the a file without the BOM characters and you would need to use a different programming editor.
  4. The input, creation, manipulation, storage/retrieval, and display of information is what computers and the programming languages that run on those computers were created to do. So, yes, you can create a flowchart application using php. Since you did not define what part of creating the flowchart in the posted image you are tasked with, it is not directly possible to provide relevant help. What you cannot do is expect a programming help forum to tell you how to define, design, and program an entire application or anything more than a block or two of code that accomplishes something that your application needs in the few hundred words that could/would be written in the responses in a thread in a forum. That is simply beyond the scope of what a help forum can do. I've got to guess that you would not have been assigned such an advanced task unless the background material necessary to do so had already been presented using a specific programming language. What a programming help forum can do is to answer specific programming questions, one at at time (i.e. how do I store the color value for each display element), help with specific problems with code you have written (i.e. my color value is not making it into the HTML, I have stepped through my code to see what it is doing and I just cannot find what is causing this problem, here is the relevant code responsible for retrieving the data and outputting it, what the data is in the database, what result I am actually getting, and what result I expect), or help with specific errors (i.e. I am getting the following php error message and after reading the error message and reading through the code I cannot solve it, here is the exact error message and here is the code leading up to that error.) So, do you have a (one at a time) specific question about making a flowchart application or a specific question about a problem or an error with some code you have written?
  5. You must execute each query individually, for a couple of reasons - 1) You would want to use error checking, error reporting, and error recovery logic on each query and 2) mysql_query() does not support multiple queries separated by semi-colons ; because too many 'programmers' are not validating and escaping their data to prevent sql injection. Executing multiple queries manually against the database is a special case where a human is involved in the process and he can address any errors that occur. A program attempting to do the same thing must be bullet proof so that an error in one step does not carry through and insert invalid data in the following steps.
  6. Please DON'T use the global keyword to bring values into a CLASS. That breaks the general purpose nature of a class definition and you might as well not bother making a class (or a function) out of the code.
  7. http://us2.php.net/manual/en/session.idpassing.php
  8. The session id is propagated between pages by the browser. The default method (and per your phpinfo() output) is to use a session id cookie.
  9. The syntax of your INSERT query is not valid. The only current way of getting mysql to perform a multi-table insert would be to set up a TRIGGER to insert data into the dependent tables - http://dev.mysql.com/doc/refman/5.1/en/faqs-general.html#qandaitem-23-1-1-3
  10. Any chance you have configured your browser so that it does not accept any cookies.
  11. Add the following three lines of code immediately after the first opening <?php tag - ini_set("display_startup_errors", "1"); // I suspect this setting will reveal the cause of the problem ini_set("display_errors", "1"); error_reporting(E_ALL);
  12. What is your actual code that is displaying the value? You have only posted your code that is testing if it is set and incrementing it or setting it to 1.
  13. Do you have error_reporting set to E_ALL (or higher) and display_errors set to ON in your master php.ini and you have confirmed what the settings actually are using a phpinfo(); statement (in case the php.ini that you are changing is not the one that php is using)?
  14. According to his statement and his example, he wants both opposite values to match.
  15. This is just off of the top of my head, but you can probably join the table to itself (giving every row combination) then pick the rows where the the left table column a = right table column b AND left table column b = right table column a. Untested but should be close - SELECT id, col_a, col_b FROM your_table as t1 JOIN your_table as t2 WHERE t1.col_a = t2.col_b AND t1.col_b = t2.col_a
  16. Save your file(s) without the BOM (Byte Order Mark) characters.
  17. So far you have provided zero information about what those results are vs what you expect. Without that information, no one can possibly determine which of the dozen or so possible things that could go wrong is actually causing the problem.
  18. The post by ym_chaitu was totally irrelevant to your question. Do you have an actual problem you are trying to solve? Best guess on the information you have posted so far is that someone was trying to feed your script an invalid value to see if it would trigger an error in your validation logic to see if that gives out information about your server or script or to see if it triggers a database error that would then indicate that sql could be injected through your code.
  19. It's not a matter of a correct version of mysql (the sql parser cannot tell your wrong syntax from a feature that might have been added in a later version), it is a matter of getting the syntax correct. There should not be any single-quotes around the 'SHA()' term. That part was correct in your original post and ym_chaitu introduced an error (which is another reason it is generally best to explain what is wrong with something, rather than to post 'fixed' code.)
  20. This should (untested) select the rows you want - $start = '2009'; $end = '2010'; $testsql = "SELECT SUM(bedrag) as total, EXTRACT(YEAR_MONTH FROM date) as y_m FROM provisie WHERE werknemer_id = $validid AND YEAR(date) BETWEEN '$start' AND '$end' GROUP BY y_m";
  21. $_SERVER['HTTP_USER_AGENT'] is just a header that is sent with the http request. It can be set to anything.
  22. Your code does not define the function mysql_prep(), either directly or through an include/require statement, so you are getting a fatal runtime error. You should be developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your php.ini so that php would help you by displaying all the errors it detects. You would save a TON of time.
  23. Did you attempt to get support from the author, considering it is a purchased script?
  24. Php would let you do this using variable-variables, but you already have the data in an array(s). There is nothing wrong with using array variables directly. Why waste the processing time and memory (you would be doubling the amount of memory required unless you unset() the original data), then you must keep track of the variable names you just created. Also, accessing a variable-variable takes three-time longer than accessing an array variable (an important consideration if you have a lot of data to process.)
  25. It would be to your advantage to build your query statement in a variable (then simply put the variable holding the query into the mysql_query() statement) so that you can echo it to see exactly what it is. It's likely that the variable $new_table_name is empty.
×
×
  • 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.