Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Your query is failing because the table name is enclosed in single-quotes, making it a string rather than a table name. Once you fix that error, you do know that you can use the mysql SUM() function directly in your query to do this. No slow loop using parsed, tokenized, interpreted php code is needed.
  2. You must be referencing them as a number at some point, rather than as a string. When you look directly in the database table as the leading zero's present in the data or does this problem show up when you display the values? You can correct the existing data, but until you find at what point during the processing the leading zeros get dropped, any new data will have the same problem. The simplest solution would be to always left pad the string with zero's, either at the point they are inserted or at the point where you display them.
  3. Zipcodes are not actually numbers. They are formatted strings consisting of numeric digits. As soon as you store them as a number they will loose any leading zeros unless you define them as having leading zeros. What is your column definition?
  4. Your form is invalid HTML (it has two <form> tags with only one closing </form>.) Any browser it did work with is simply ignoring the HTML errors on the page and submitting the data.
  5. Has that code worked ever, such as on your development system, before you put it on to a live hosting server?
  6. http://dev.mysql.com/doc/refman/5.1/en/insert-on-duplicate.html
  7. Should be close - SELECT COUNT(*) as cnt, MONTHNAME(date_added) as mn, YEAR(date_added) an yr FROM content GROUP BY yr, MONTH(date_added) DESC
  8. Find out why the move_uploaded_file() statement is failing by getting php to display all the errors it detects. Add the following two lines of code immediately after the first opening <?php tag - ini_set("display_errors", "1"); error_reporting(E_ALL);
  9. You wrote the answer in your question - WHERE cupID = 19 and (clan1 = 340 or clan2 = 340)
  10. The part of your query that is empty is using $vals[id] and $vals comes from the $_POST array. That has nothing to do with $_SESSION['id'].
  11. Read the error message (please). It tells you where the output is occurring at.
  12. Code should not normally produce any errors when it executes, so that real errors can be found and fixed (such as when a hacker feeds your code all kinds of unexpected data that your validation logic does not handle.) On a development system, display_errors should be ON and error_reporting should be set to at least E_ALL so that all the php detected errors are reported and displayed. On a live server, display_errors should be OFF and log_errors should be ON, so that php errors are not displayed but they are logged. error_reporting should be set the same as on a development system.
  13. First, you need to define what you want the code to do. Do you want only one checkbox to be selected at a time or do you want to allow any where from 1 to all 3 checkboxes to be selected?
  14. The code you did post is NOT using the $header variable, which is probably for the best because you are putting the entered email address in as the From: address. The From: address must be a valid email address hosted at the sending mail server or there must be an SPF DNS record at the domain in the From: address that says that your mail server is authorized to send email for that domain.
  15. Nothing you have posted so far indicates what problem you are having. Best guess is that the answer to your problem is: 42
  16. http://dev.mysql.com/doc/refman/5.0/en/date-calculations.html
  17. Nothing you have posted sets a $_POST variable named 'id'
  18. We cannot really help you without seeing the form that generates those values and the code you actually used to var_dump the id (and where it was at in the code.)
  19. How do you know that the problem is due to the imageconvolution() function?
  20. We cannot really help you with errors unless we see the error message and the code that produces the error.
  21. Echo $sql so that you can see exactly what it contains. Based on both the php error and the mssql error, the id does not exist.
  22. You are using double-quotes around the values, which causes them to be treated as identifiers (i.e. column, table, or database names.) You need to switch the use of quotes. Use double-quotes at the start and end of the php strings and use single-quotes inside the sql syntax.
  23. The ONLY thing your code is doing that is php5 specific is using the mysqli extension (which would account for the blank pages because you would be getting a fatal runtime error.) The end of life of php4 was over two years ago. Your web host should have provided a way of selecting php5, either through a control panel menu item or through adding a command in a .htaccess file. Spend your time updating the account to php5, not wasting your time fixing non-problems in the code.
  24. Temporarily comment out the header() redirect statement and echo mysql_error() on the next line following the mysql_query() statement to find out why the query failed.
  25. You haven't exactly told us what it IS doing, in order to pin down which of the dozen possible things that could be going wrong. What do you see in front of you when you submit the form?
×
×
  • 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.