Jump to content

Barand

Moderators
  • Posts

    24,573
  • Joined

  • Last visited

  • Days Won

    824

Everything posted by Barand

  1. You could check if the age value is numeric. If it isn't (header), skip the insert.
  2. Exclude dates that you don't want to display in the original query. Don't select them then hide them.
  3. You said that "CNT_TXT_WARNING_EMAILSENTOK" is defined in a text file. How do you get it from said text file to that script?
  4. It worked well enough for me to produce that output. You may have to make one or two minor tweaks to adapt it to your database and table.
  5. I already gave you the code that produced that output. How much more help do you need?
  6. My guess, and what my code in #8 above gives, was
  7. Do have CNT_TXT_WARNING_EMAILSENTOK defined anywhere, for example define("CNT_TXT_WARNING_EMAILSENTOK", "This is a message to say it is OK");
  8. Your implementation is nothing like my example. The STR_TO_DATE() in my example is in the VALUES(..) part, you have just added in the columns part.
  9. You need to put dates into the database in yyyy-mm-dd format so if your datepicker is using dd/mm/yy then the date needs converting. You can do this in SQL with the method shown in this example INSERT INTO table (mydate) VALUES (STR_TO_DATE($datepickerdate, '%d/%m/%y') )
  10. Moving to AJAX forum
  11. You need to concatenate header("Location:../presupuesto.php?msg=" . CNT_TXT_WARNING_EMAILSENTO);
  12. row is an object but row.id_itens isn't. You could have just done this (without the stringify) $('#myModal').modal('show').find('.modal-body #id_itens').val(row.id_itens);
  13. Unless it's an object or an array there is no need to stringify.
  14. Don't put the closing ?> at the end of included files.
  15. I see you bind the value with "PDO::PARAM_STR" yet your data (6 and 11) are numeric, How is id_itens defined?
  16. Are you sure the spelling is correct? $sql = 'DELETE FROM `item` WHERE `id_itens`=:me';
  17. Why are you preparing, binding then executing the query twice? That will write each record twice to the table.
  18. try something like this <?php include('db_inc.php'); // defines HOST etc $db = new mysqli(HOST, USERNAME, PASSWORD, DATABASE); $sql = "SELECT firstname , lastname , local FROM member ORDER BY firstname, lastname"; $local = ''; $nonlocal = ''; $res = $db->query($sql); while (list($fn, $ln, $loc) = $res->fetch_row()) { if ($loc=='Y') { $local .= "$fn $ln<br>"; } else { $nonlocal .= "$fn $ln<br>"; } } ?> <html> <head> </head> <body> <table border='1'> <tr><th>Local</th><th>Non-Local</th></tr> <tr style='vertical-align: top;'> <td><?=$local?></td> <td><?=$nonlocal?></td> </tr> </table> </body> </html>
  19. Yes, it will. For the THIRD time (and last), do not put those variable inside single quotes. $stmt->bindValue(':fname', $_POST["fname"]); If you totally disregard the advice given, why bother posting at all and waste our time.
  20. You are still repeating the same mistake. Read and learn. Also you should check that the values were posted before using. You almost had this check but commented out the code. That check should have enclosed the query too otherwise you check if they exist but then go ahead and use them anyway.
  21. You are missing the word "WHERE" in the query
  22. There is a multi query option but I have never found the need to use it. In you example I cannot see a need either. If you want to separate the local and non-local you can ORDER BY local. If, as it appears, you are only interested in how many of each SELECT local, COUNT(*) as total FROM members GROUP BY local;
  23. Make the directory separator / instead of \
  24. The string you are echoing is in single quotes therefore the variable is not expanded. Use double quotes echo "<img src='\$template[0]' >";
×
×
  • 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.