Jump to content

rledieu

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by rledieu

  1. Hi, I have a need to clear down a field in a table prior to re-filling it with new values. If in the PHP page I clear it down and then immediatley run the query to fill in the values I find that the first query hasn\'t finished in time and therefore wipes out new values. The cose is: $query = "update LOW_PRIORITY " . $selDim . " set limitint = null;"; $result = mysql_query($query) or die($selDim . " Update (set to NULL) failed"); $i=0; while ($_GET["selChosen"][$i] != "") { $query= "update " . $selDim . " set limitint = " . $i . " where dimvalue = \'" . $_GET["selChosen"][$i] . "\'"; $result = mysql_query($query) or die($selDim . " Update (set limitint) failed"); $i++; } $selDim is the table name. The Values are based on a multiple selection box and I use the value that I place in the field for ordering purposes. Can anyone tell me what I amdoing wrong - or is there a way of putting an appropriate if-then clause in the MySQL? Thanks
  2. I have found that you need to include information about the delimiters if you are working in a Windows environment. I use TABs to delinieate fields and then I use the following command: load data infile \'d:/test.txt\' into table test fields terminated by \'t\' lines terminated by \'rn\'; Notice the need to specify the Carriage Return, New Line combination. Without it this doesn\'twork. Alternatively have you tried load data local infile ... ?
  3. Hi, Here is the code as it was - I have currently commented out the first two lines and tried a workaround that I am not happy with. It is fairly generic so probably difficult to understand. I have a table of Months where Month is known as a \"Dimension\". I also have dimension tables for Product and Customer (for example). The GUI drop down lists the various dimensions that are available and then populates the $selDim variable with the name of the table containing this list. The field \"LIMITINT\" is an integer field that contains an integer which is based on the order that the user chose the values in - null if the value wasn\'t chosen. Going into this piece of the routine LIMITINT will contain values. I need to clear them down and then reset them based on the users choices. $query = "update LOW_PRIORITY " . $selDim . " set limitint = null;"; $result = mysql_query($query) or die($selDim . " Update (set to NULL) failed"); $i=0; while ($_GET["selChosen"][$i] != "") { $query= "update " . $selDim . " set limitint = " . $i . " where dimvalue = \'" . $_GET["selChosen"][$i] . "\'"; print $query . "<BR>"; $result = mysql_query($query) or die($selDim . " Update (set limitint) failed"); $i++; } Does that help? You can see the screen in question at http://www.besthq.com/genmysql.htm - the second image \"The Selector Tool\". This code runs when the user clicks on OK
  4. I have a problem where I have a field that represents a flag in a table and as a result of an action in PHP I issue a statement to clear down the flag. Then I issue a command to reset the flag based on user input. Unfortunately the first command hasn\'t finished and the second command kicks in and therefore I get an incorrect result. How do I prevent this from happening in the PHP statements that I issue to MySQL?
×
×
  • 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.