Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. You probably deleted the two blank lines that were before the first opening <?php tag in your file.
  2. Define: doesn't work? That could mean a dozen different things, each with a different cause. At least tell us what symptom you see in front of you that makes you think it is not working. And are you debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php would report and display all the errors it detects. You will save a TON of time.
  3. ^^^ You don't. You take the MM-DD-YYYY submitted value and you reformat it as a standard YYYY-MM-DD value to be inserted into your table. Since you are probably breaking the submitted value into its' individual parts in order to validate it, it is easiest to simply put it back together in the correct format. Another way to change a MM-DD-YYYY format into a YYYY-MM-DD format would be to use the mysql STR_TO_DATE() function in your INSERT query. ^^^ That would be where you would use the the DATE_FORMAT() function in a query.
  4. The msyql DATE_FORMAT() function ONLY takes the values you give it as arguments and returns the formatted value. You use it in any query that you want to get a standard YYYY-MM-DD DATE value into any other format.
  5. A complete query would be - SELECT DATE_FORMAT(date_ship, '%m/%d/%Y') FROM your_table
  6. From your first post in this thread - SELECT DATE_FORMAT(your_date_column_name_here, '%m/%d/%Y')
  7. You format the data the way you want it to be in a query. It always remains the YYYY-MM-DD format in the database table.
  8. One of the main points to remember concerning retrieving data from a database is to retrieve it in the order that you want it. Then you simply display it the way you want. For your question, you would use an ORDER BY type in your query so that the data for each type is together in the result set. You then simply detect when the type changes in your code and output a new heading when the type changes value (any typo's in the code are there as a test) - $result = mysql_query("your query here"); $last_type = NULL; // set to a value that will never appear in the data while($row = mysql_fetch_assoc($result)){ // test if the 'type' changed and do any special processing if($last_type != $row['type']){ // output a new heading - echo "{$row['type']}<br />"; $last_type = $row['type']; // remember the current value } echo "{$row['data']}<br />"; // output the data value }
  9. Because php has the ability to log mail() function calls (see the mail.log setting) it expects the timezone to be set. You could set the timezone to the correct value for your server (in case you decide to use any time dependent functions) to prevent the generation of those Warning messages. Code should not produce any notice, warning, or error messages during its' normal execution. Only for abnormal conditions. If your error log is full of hundreds and thousands of notice and warning messages because you did not correct the condition causing those, it makes it extremely difficult to find REAL problems when they occur, such as when a hacker starts feeding your script all kinds of unexpected data in an attempt to break into your script.
  10. A) Your form and form processing code worked for me after I fixed the php tags near the end of it, B) You are likely still getting a fatal parse error due to bad php syntax (which is the most likely cause of a blank php page), C) 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 master php.ini, so that all the errors php detects will be reported and displayed.
  11. If you read the whole error message, it tells you where your code is sending output at that is preventing the header (needed for the session_start()) from working.
  12. The php code you posted does not have a session_start() statement in it (assuming you posted all the code in the file), so it is unlikely that your $_SESSION variable has a value. You could always check what your query actually contains by echoing the $sql variable.
  13. <? ^^^ change that line to us a full opening php tag - <?php or better yet, don't put a closing php tag and then put an opening php tag right after it. Change the following - ?> <? } ?> to this - } ?>
  14. As long as you execute a session_start() statement in the .php code that is being requested, you don't need to do anything else, such as outputting an image.
  15. IF (the big if) they were using a proxy server as their Internet gateway at each locaion and IF (another one) it was supplying the internal IP address using the HTTP_X_FORWARDED_FOR header, then you could get the internal network address out of the http request.
  16. The key to effectively using any function in programming is to read the documentation for that function, especially if you get an error when you use that function - mysql_affected_rows() (optionally) accepts the connection link identifier as a parameter.
  17. Php and the extensions must be the same version and thread-safety setting.
  18. You cannot output ANYTHING (including a html doctype tag or any other character) before you use a php header() statement as that prevents the header() from working. If you were developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini, php will help you by reporting and displaying all the errors it detects.
  19. $re = mysql_query($sql); echo mysql_errno() . ": " . mysql_error() . "\n"; Edit: updated to match the code in your first post. Edit2: Yes, if you don't have a table named counter with a column named count, there's no point in executing queries against it.
  20. You are missing the single-quotes that actually break out of and back into the php quoted string - echo '<a href="javascript:void(0);" onMouseover="ddrivetip(\''.$details.'\')" onMouseout="hideddrivetip()">More Details</a>';
  21. Mchl's post contains a link to the php.net manual section that shows a code example of how to use it after a query.
  22. Read Mchl's post above and use mysql_error() to find out why your query is failing. The extraneous posting by Chidori Soul that did not have anything to do with troubleshooting why your code is not working just derailed the thread.
  23. http://us4.php.net/mysql_data_seek
  24. Meaning what? Different paths on the end of the URL? If so, go back and read in my last post above about the session.cookie_path setting.
  25. See the session.cookie_domain setting at this link - http://us3.php.net/manual/en/function.session-set-cookie-params.php
×
×
  • 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.