Jump to content

Barand

Moderators
  • Posts

    24,612
  • Joined

  • Last visited

  • Days Won

    834

Everything posted by Barand

  1. You need to concatenate header("Location:../presupuesto.php?msg=" . CNT_TXT_WARNING_EMAILSENTO);
  2. 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);
  3. Unless it's an object or an array there is no need to stringify.
  4. Don't put the closing ?> at the end of included files.
  5. I see you bind the value with "PDO::PARAM_STR" yet your data (6 and 11) are numeric, How is id_itens defined?
  6. Are you sure the spelling is correct? $sql = 'DELETE FROM `item` WHERE `id_itens`=:me';
  7. Why are you preparing, binding then executing the query twice? That will write each record twice to the table.
  8. 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>
  9. 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.
  10. 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.
  11. You are missing the word "WHERE" in the query
  12. 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;
  13. Make the directory separator / instead of \
  14. The string you are echoing is in single quotes therefore the variable is not expanded. Use double quotes echo "<img src='\$template[0]' >";
  15. In other words, never miss out on an opportunity to expose your database structure to the world at large
  16. In that statement you are setting the :fname parameter to the literal string $-f-n-a-m-e and not the contents of the variable $fname. That is because of the single quotes around the variable. Variables inside double-quotes are expanded to their values but those inside single-quotes are not. Lose the quotes around the variables. Should be $stmt->bindValue(':fname', $fname);
  17. The INSERT appears to do nothing because that is exactly what it is doing. You have to execute the query.
  18. $imagefiles = glob("images/download*.{png,jpg,gif}", GLOB_BRACE); echo '<pre>',print_r($imagefiles, true),'</pre>';
  19. Every post I make says it in my sig
  20. did you add this line and rerun the code? if ($records==false) echo mysql_error();
  21. $sql="SELECT * FROM APARTMENTS"; $records=mysql_query($sql); if ($records==false) echo mysql_error(); See what the error message tells you.
  22. Then your query failed and mysql_query is returning "false" echo mysql_error() after calling mysql_query() to see why
  23. Take a look at the glob function
  24. try this SELECT sc.StringyChat_name , sc.StringyChat_ip , sc.StringyChat_time FROM StringyChat sc INNER JOIN ( SELECT StringyChat_name , MAX(StringyChat_time) as StringyChat_time FROM StringyChat GROUP BY StringyChat_name ) latest USING (StringyChat_name, StringyChat_time) WHERE sc.StringyChat_time >= (UNIX_TIMESTAMP() - 3600) AND StringyChat_name NOT IN ( '" . implode($galleries, "', '") . "' ) ORDER BY StringyChat_time DESC LIMIT $offset, $rowsperpage If that gets what you want then you need to JOIN to user2 to get the id's in the same query. (Don't run queries inside loops)
×
×
  • 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.