Jump to content

mikosiko

Members
  • Posts

    1,327
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mikosiko

  1. seems that you did answer yourself..... use brackets in the same way in your sql
  2. read .... http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat
  3. for your second step you need an UPDATE no an INSERT
  4. if this is your last code: <?php session_start(); $_SESSION = array(); if (ini_get("session.use_cookies")) { $params = session_get_cookie_params(); echo $params; // REMOVE IT die(); // REMOVE IT setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"] ); } else { // REMOVE THIS LINE die('Didn\'t Work'); // AND THIS TOO } session_destroy(); //header('Location: index.php'); // AND MAYBE YOU NEED THIS LINE TO BE ACTIVE ?> did you try removing completely that last else sentence (look the comments in your code) and see what happens?
  5. you are not executing the query ($query), hence $result doesn't exist
  6. what have you done to debug your code? a basic debug will be to display in update_ac.php the values for the POST'ed variables 'parts', 'press', 'mold' and 'ID' and see if they have the right values. Also a display of your raw query ($sql) could help you to evaluate if the UPDATE sentence is constructed correctly.
  7. depending on your PHP version this http://www.php.net/manual/en/datetime.diff.php could be an option too.
  8. well.. that could mean that your csv file has not the right format or could be corrupt... without seeing the original file is hard to tell what could be wrong with it. other simple test is do what I did... copy/paste your example data and try to upload it with the provided command (yours or mine) and see if you got the same behavior.
  9. using your data example (without headers) this worked perfect for me (adjust your fields/ variables accordingly) LOAD DATA INFILE '$file' INTO TABLE MyTable FIELDS TERMINATED BY ',' (f1,f2,f3,f4,f5,@f6,f7) SET `f6` = STR_TO_DATE(@f6, '%m/%d/%Y');
  10. what about the LOAD DATA INFILE that you are using?... I don't see nothing wrong with that data format, LOAD DATA should work
  11. could you post some lines of your csv file?
  12. and that is exactly what you were asking for... so the example and solution works. because we don't know how are you trying to do the same in PhpMyadmin is not possible to answer why "is not working" for you.... I just tested PhpMyAdmin on my side and it does work perfectly too, therefore most likely you are no doing the right thing...
  13. Huh?... don't follow.... the provided example does work... post exactly what you wrote and the results
  14. which part you don't understand?... the GRANT part or the other? anyway... for the other part you can do a simple test.... 1) with whatever tool that you are using (phpmyadmin?) run this script: DROP TABLE IF EXISTS `testdate`; CREATE TABLE `testdate` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `date_created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `date_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `other` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; 2) after the test table has been created run this sentence: INSERT INTO testdate (date_created, other) VALUES (NOW(), 'this is anything'); and then check the inserted value in the table with: SELECT * from testdate; and check what happens with the value on the field date_updated wait some time... and run this sentence now UPDATE testdate SET other = 'what happens now'; check the values again with the previous SELECT... and look for what happen to the value of your field date_updated more clear now?
  15. depending of your host's Mysql version you will need to be granted with a GRANT TRIGGER (MYSQL 5.1.6 and up) or GRANT SUPER (for previous versions). If your host's Mysql version is prior a 5.1.6 that could be the reason for them to do not allow it. however... you can replace those 2 simple triggers just including the functionality (the values for your fields) directly on your INSERT or UPDATE sentences
  16. there are several examples here --> http://php.net/manual/en/mysqli-stmt.bind-param.php that show different ways to implement what you are trying to do... just read the examples and adapt the one that you like the most... there are even explanation and solution for your last error.
  17. You table selected_operators has only a PK (Primary Key) on the column `id`, however you need to JOIN that table with the table login_users using the common column user_id, therefore adding an INDEX on that column in the table selected_operators will improve the query performance. use whatever tool that you are using now to add that index in your table.... basically: ALTER TABLE `selected_operators` ADD INDEX `name-of-your-index-here`(`user_id`);
  18. try this: SELECT a.user_id, a.cname FROM login_users a LEFT JOIN selected_operators b ON a.user_id = b.user_id AND b.operator_id = 3 WHERE a.user_level = 3 AND b.operator_id IS NULL; Adding an INDEX on the column user_id in the table selected_operators should help too.
  19. in the same way that you are echoing the other variables (well done)... echo your $_POST['orderid'] and check the content... also you can echo your $sql query before to execute it and validate if you are getting what you are expecting
  20. No... he is not doing a comparison in that line of code.. just assigning a Boolean value to the variable $valid
  21. after small adjustments... try this (SELECT a.cupid, a.ladid, a.matchno, a.clan1, b.clan2 AS 'versus', a.comment, a.1on1 FROM ws_bi2_cup_matches a JOIN ws_bi2_cup_matches b ON a.cupID = b.cupID AND b.cupID = 'a' AND b.matchno = '6' AND a.clan2 != b.clan2 AND b.type = 'gs' WHERE a.matchno = '6' AND a.type = 'gs') UNION (SELECT a.cupid, a.ladid, a.matchno, a.clan1, b.clan1 AS 'versus', a.comment, a.1on1 FROM ws_bi2_cup_matches a JOIN ws_bi2_cup_matches b ON a.cupID = b.cupID AND b.cupID = 'a' AND b.matchno = '6' AND a.clan1 != b.clan1 AND b.type = 'gs' WHERE a.matchno = '6' AND a.type = 'gs') ORDER BY clan1 DESC, versus;
  22. quick and dirty, but I believe that is what you want (same query that you have before in Query 2 just using JOIN and UNION for the second part) SELECT a.cupid, a.laid, a.matchno, a.clan1, b.clan2 AS 'versus', a.comment, a.1on1 FROM ws_bi2_cup_matches a JOIN ws_bi2_cup_matches b ON a.cupID = b.cupID AND b.cupID = 'a' AND b.matchno = '6' AND a.clan2 != b.clan2 AND b.type = 'gs' UNION SELECT a.cupid, a.laid, a.matchno, a.clan1, b.clan1 AS 'versus', a.comment, a.1on1 FROM ws_bi2_cup_matches a JOIN ws_bi2_cup_matches b ON a.cupID = b.cupID AND b.cupID = 'a' AND b.matchno = '6' AND a.clan1 != b.clan1 AND b.type = 'gs' WHERE a.matchno = '6' ORDER BY clan1 DESC, versus;
  23. before this line <a href="<?php echo (defined('S2MEMBER_CURRENT_USER_LOGIN') ? S2MEMBER_CURRENT_USER_LOGIN : post_name);?>/">Client Area</a> did you check that the constant S2MEMBER_CURRENT_USER_LOGIN and/or post_name are not null or empty?
  24. something to read: http://php.net/manual/en/language.variables.scope.php take a look what are you doing here $result = $db1->insert_GeneratedNumber($OBSERVATION_ID, $NUMBER); and how that is different of what are you doing here (respect to how are you using the variables) $OBSERVATION_ID = $db1->insert_Observation();
×
×
  • 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.