Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Ingolme

  1. Without seeing your code I can't tell what's wrong but it looks like you're probably mixing up the procedural and object-oriented versions of the functions.
  2. Use mysqli_error() to find out what went wrong with the query. It looks like you forgot to add a VALUES() section to your INSERT query.
  3. Ingolme

    Character Encoding

    I'm not sure what an ERP is, but it seems to be storing data with the wrong encoding in the database. The only solution is to detect the encoding of the string and convert it after retrieving it from the database, as you were trying earlier. If utf8_encode() is not working, it means that the encoding is probably not ISO-8859-1. I don't think I can help much if mb_detect_encoding() is not working. You will have to find out why the function is not available.
  4. If you don't have a unique key, it won't find a duplicate, so it will not update any of the records and it will create a new one instead. After adding the ON DUPLICATE KEY UPDATE section to your query, the code now has 8 "%s" placeholders, but you are only passing in four values to the sprintf() function.
  5. You will need to specify a unique key in your table. Which of those fields has to be unique?
  6. Ingolme

    Character Encoding

    If your HTML document has the encoding set to UTF-8 using a <meta> tag and your PHP files are UTF-8 encoded, any form data should automatically be converted to UTF-8 no matter what the user pastes in. If you have a database connection, make sure that the encoding of the connection is UTF-8 as well.
  7. An INSERT query always creates a new record. If you want to update a record, you need to use an UPDATE query.
  8. Ingolme


    If they're telling you to just use Wordpress, I would hardly call them professionals. The first step, before applying media queries, is to make everything flexible. Don't give fixed widths to anything. For example, the header, section and footer you can set max-width instead of width: #header, section, footer { max-width: 1080px; } The site content and side bar need to be replaced with percentage values: #sitecontent.sitecontentleft { width: 72.22%; } #sidebar.sidebarright-index { width: 25%; } The media queries will only be necessary once things get too small to nicely fit two columns. You choose a breakpoint by eye based on when you think it stops looking good. At the breakpoint, you would stack things vertically. The easiest way to do that would be to remove all float declarations and set the width to auto. @media screen and (max-width: 800px) { #sitecontent.sitecontentleft, #sidebar.sidebarright-index { float: none; width: auto; } } The media query must go after all the other rules in order to be able to override them.
  9. What does your code look like? There is no way the "&" could be interpreted as an operator if it is inside a string unless you have a severe security vulnerability in your code.
  10. That is not the flex-grow property, it is the flex-basis property.
  11. I think you could use getComputedStyle() to find out what background image has been applied and then generate an <img> tag. It's a bit complicated, especially if you want to keep everything exactly where it is. You'll have to pull out the values of background-size and background position and use them to set the size and position of the <img> tag. Repeating backgrounds would make things a lot more complicated.
  12. Please do not reply to old topics.
  13. You cannot pass values to addEventListener callbacks. Callbacks have to be just the name of the function without parentheses. If you use parenthesis, you will call the function immediately and assign its return value as an event listener instead.
  14. Ingolme

    It is SCSS, not SASS

    Are you referring to the SASS tutorial? https://www.w3schools.com/sass/default.asp SASS is a CSS preprocessor: https://sass-lang.com/
  15. It is probably faster to reach them by email. I am not sure how frequently they look at the forums. At the bottom of each page is a button labeled "Report error". If you click on it it displays the email address (help@w3schools.com) to which you can indicate a mistake on any page.
  16. In UTF-8 encoding, any Unicode character with a code higher than 127 is split into multiple bytes. Each byte starts off with a number of 1s indicating how many of the following bytes belong to the same character. UTF-8 encoded bytes have structures like the following: 0XXXXXXX 110XXXXX 10XXXXXX 1110XXXX 110XXXXX 10XXXXXX Your character has to be split into two bytes because its Unicode value is highter than 127. Its binary representation is: 10111101. These bits are split into the following two UTF-8 bytes: 11000010 10111101. The hexadecimal representation of the above bytes is C2 BD If you're actually seeing the C2 character, it means that the the software reading the bytes is not aware that it is UTF-8 encoded. The email has to contain a header indicating that it is using UTF-8 as the character encoding.
  17. I think it looks correct. It is passing a two-byte UTF-8 encoded character. The %## encoding in a URL can only have two characters following the %. If you have a multi-byte character, each byte will be encoded on its own. The server should be able to decode it without a problem as long as it is treating strings as UTF-8.
  18. It has an error because you forgot to declare i with the var keyword.
  19. This pattern should work: ([0-9]{9})?
  20. The best way to learn is to set yourself a project and try to accomplish it. Along the way you'll run into problems you don't know how to solve. When you do, you do research on those specific things and that is how you learn. You will find tools in Java which do what you need them to. The more problems you run into while developing something, the more things you will learn when researching the solutions to those problems. On the other hand, try not to start a project that is too far out of your reach.
  21. Ingolme

    my borders are mixing

    This is the behaviour I would expect to see from inline elements. Most likely setting them to display: block will solve the issue.
  22. What is self.view? It looks like you may be using some kind of framework. Without knowing which framework you are using and how the framework works I can't tell you how to solve this.
  23. Use an <a> tag, give it a class attribute and then remove the underline using the class as a seletor. <div class="w3-panel"> <a href="other-page.html" class="box-link"> ... </a> </div> CSS: .box-link { text-decoration: none; }
  24. You can use the border-spacing property to set the spacing between the cells horizontally and vertically. table { border-spacing: 0 5px; }
  25. The page loads in order from top to bottom and the Javascript runs as soon as it can even if the rest of the page has not loaded yet. One way to solve it is to always put scripts before the closing </body> tag. Another way is to have the code wait for the page to load before assigning the event listener. This can be done with the DOMContentLoaded event: window.addEventListener("DOMContentLoaded", attachEvents); function attachEvents() { var p = document.getElementById("btn"); p.addEventListener ("click", test); } function test() { alert("Test"); }
  • Create New...