Jump to content

Ingolme

Moderator
  • Content Count

    14,409
  • Joined

  • Last visited

  • Days Won

    101

Everything posted by Ingolme

  1. You already created a topic for this question. Please continue discussion there.
  2. In the code above, the main issue is that your string is wrapped in single-quotes, so the variable does not get parsed. In PHP, single-quote strings and double-quote strings are different. $timenow = '5'; echo 'SELECT * FROM times where timings > $timenow'; // This prints: SELECT * FROM times where timings > $timenow echo "SELECT * FROM times where timings > $timenow"; // This prints: SELECT * FROM times where timings > 5 The $timenow variable should be wrapped in quotes since it is a string and not a number. I haven't worked with SQLite before, but if possible, you shoul
  3. The join() method will turn an array into a string with whichever delimiters you like. Since you have nested arrays, you'll have to loop through them and construct string from them. There are multiple ways to do it, here's one: let x = [ ['a','b','c'], ['d','e','f'], ['g','h','i'] ]; var out = []; // Temporarily store the internal strings in here. var item, str; // Variables used in the loop for(var i = 0; i < x.length; i++) { item = x[i]; // Access one of the internal arrays str = item.join(""); // Turn the internal array into a string out.push(str); // Add the string to t
  4. From that code, it looks like your regular expression is ^''+61. You probably should remove those quotation marks and escape the backslash. var pattern = "^\\" + data_code;
  5. Ingolme

    Help me please

    This is not a PHP problem, this is a database architecture problem. What is the structure of your money_transfer table? How is the relation between the money_transfer and the users table defined?
  6. I don't see any major drawback aside from how you would achieve that. I'm wondering how you would identify that a user came from a VPN. Even without a VPN, the business owners may not necessarily always be operating from the same IP address. They might have a dynamic IP or they might be working from a different location.
  7. Ingolme

    Help me please

    You don't have to. The money_transfer table should have its own user_id field by which you search for records.
  8. Code inside a function only has access to the function's arguments and variables that were declared inside the function. Did you really need to wrap your code in a function?
  9. Ingolme

    Help me please

    The money_transfer table must have a user_Id field. Does it have a user_id field?
  10. The only reliable solution is to associate likes to an account. Google offers OAuth2 to be able to identify people by their Google accounts.
  11. Unfortunately, the W3Schools staff doesn't visit the forums. The CSS tutorial won't teach you how to make buttons do things, because the purpose of CSS is only to change the appearance of things. If you want to learn how to make things happen when a button is pressed, you should learn Javascript which is considerably more difficult to learn than CSS.
  12. Ingolme

    Help me please

    It is not clear what you are trying to accomplish and I have no idea what your database table structure is. Assuming the money_transfer table has a user_id field, here's how to get all transfers for a user: SELECT * from money_transfer WHERE user_id = 5
  13. Ingolme

    Help me please

    Please keep your question in one topic. There is already a topic here:
  14. There's no variable $username inside the function.
  15. There isn't a regular expression that will count characters if they're not consecutive. You'll have to match the string and then count the number of matches instead. var lowercase = myInput.value.match(/a-z/g); var uppercase = myInput.value.match(/A-Z/g); var digits = myInput.value.match(/0-9/g); var numLowerCase = lowercase ? lowercase.length : 0; var numUpperCase = uppercase ? uppercase.length : 0; var numDigits = digits ? digits.length : 0; if(numLowercase < 199) { // Not enough lowercase letters } if(numUppercase < 199) { // Not enough uppercase letters } if(numDigits <
  16. I'm not sure what your requirement is. How many lowercase characters does the password need? How many uppercase characters does it need? Does the order matter?
  17. What exactly are you trying to match with that regular expression? It looks unnecessarily complicated. There isn't a reason to use the RegExp constructor here either. What you're checking for with that expression is 199 strings of any length, even empty strings count, containing only the specified characters You just need to check for a minimum of one of each type of character. var val = myInput.value; // Check for lowercase letters var lowerCaseLetters = /[a-z]/; if(lowerCaseLetters.test(val)) { letter.classList.remove("invalid"); letter.classList.add("valid"); } else {
  18. When you wrap the code inside a function, it loses access to all of the variables that are outside of the function. You need to pass them into the function as function arguments.
  19. There is no way to know what is wrong without seeing your code. Most likely it's something to do with duplicate IDs.
  20. Ingolme

    Help me please

    Have a field in the money_transfer table with the ID of the user involved. I'm not sure if I understood the question since this is trivial.
  21. What you're asking to do is not commonly done. The menu almost always gets reloaded along with the rest of the page and there's no real drawback to that behavior. You can work around that by loading the page content with AJAX, but that's not very SEO friendly. While I advise against frames, I have to correct you on the fact that iframes are part of the HTML 5 specification.
  22. It's just mismatched parentheses on this line: var days = Math.floor(distance % (1000 * 60 * 60 * 24 * 7)) / (1000 * 60 * 60 * 24)); Count the opening brackets and the closing brackets.
  23. Synchronous requests are deprecated since they cause the browser to freeze, many browsers don't support them anymore. You have to give your request an onreadystatechange handler and put your code in there.
  24. PHP cannot read data from Javasrcript. PHP runs first on the server, then it generates Javascript code and that Javascript code runs after the PHP has already finished. If you want to send data from a Javascript program to PHP, you have to use AJAX.
×
×
  • Create New...