Jump to content

Barand

Moderators
  • Posts

    24,606
  • Joined

  • Last visited

  • Days Won

    831

Everything posted by Barand

  1. You check that it isn't empty before running the query. At present, if $_GET is not set, you run the query to fetch all data. Get out of the habit of using "SELECT * ", specify the columns you need to retrieve.
  2. For example, https://www.php.net/manual/en/datetime.createfromformat.php https://www.php.net/manual/en/datetime.format.php
  3. The "Activity" page no longer has a "condensed" option. Selecting condensed has no effect and on refresh it reverts to "Expanded" mode. (This worked fine "last year" and the problem seems has appeared overnight)
  4. Merely defining a query string does not execute the query. If $name is empty you have "LIKE '%%' " which will match every record in the table
  5. Just before the" new mysqli()" line in that case. That's the statement that is connecting to your db server.
  6. Always put this line of code mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); before the line in your code that calls mysqli_connect()
  7. I guess the designers of the forum software thought emojis were far more important
  8. I have no such problems with my phone
  9. What if you rotate to landscape?
  10. It does disappear with narrow display sizes. Try shrinking your display (zoom out/ Ctrl-minus)
  11. Are you checking if data has actually been POSTed if ($_SERVER['REQUEST_METHOD'] == 'POST') { $nine = $_POST['username2']; $codx = $characters[$nine]->name; } else { echo "NO DATA!"; }
  12. It's [ code ]…[ /code ] (but without the spaces) or just use the <> button on the toolbar
  13. I appreciate that you need to reformat the date, but why to one with a different day, different month and 18,000 years later? However, one way to do it is to treat your date as a string value initially (ie column type VARCHAR) while you do the import. Once imported, run an update query to reformat to correct date format UPDATE mytable SET datum = TO_TIMESTAMP(datum, 'DD.MM.YYYY'); Once you have the correct format you can alter the column from VARCHAR to DATE type
  14. I cannot understand why you would change to
  15. The fastest way, by far, is to export from Access into a CSV file then use a LOAD DATA INFILE command in SQL to load the csv into the database table. The next fastest way is to take advantage of MySQL's multiple insert queries EG INSERT INTO mytablename (col1, col2, col3) VALUES (1, 'aaa', 'bbbb'), (2, 'bbb', 'cccc'), (3, 'ccc', 'dddd'), . . . (998, 'ddd', 'eeee'), (999, 'eee', 'ffff'); and load several hundred records with each insert. The slowest way is to iterate through a file, inserting one record at a time.
  16. What is the form method of the form that contains your username2 input? Is it POST?
  17. Still waiting to know what's being sent by your ajax request Example...
  18. Does this simple script work? <?php echo file_put_contents("ValidationsRedeemed.txt", 'This is a test' . "|", FILE_APPEND); ?> (It should output 15 to the browser and add "This is a test|" to your file)
  19. Personally, I'd go with file_put_contents('filename', 'content', FILE_APPEND); So much easier than fopen(), fwrite(), fclose().
  20. Alas, {}s are part of the variable variable syntax edit: $a = 'foo'; $$a = 'bar'; echo $$a; //--> bar echo ${$a}; //--> bar echo $foo; //--> bar
  21. @ginerjm those currency symbols need escaping otherwise they are interpreted as variable variables ($$price, $$number) <td>\${$price}</td> <td>\${$number}</td>
  22. Which variable doesn't echo out. They all do for me once I put something in them. (BTW, You should've learnt to use code tags by now.)
  23. A single = is an assignment operator, so if ($validation = "true") assigns the string "true" to $validation. In your second code example you are checking equality correctly but your are checking if it is equal to the string value "true". This will suffice... if ($validation) { as this means "if validation is true"
  24. Sounds like you're not doing it correctly.
  25. SELECT school , city , TRIM(REPLACE(school, city, '')) as new_school FROM school;
×
×
  • 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.