Jump to content

Drewser33

Members
  • Posts

    67
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Drewser33's Achievements

Member

Member (2/5)

0

Reputation

  1. I tried doing a chmod 777 on that directory, but the problem still exists.
  2. Mysql version 5.5 Linux OS - Debian LOAD DATA LOCAL INFILE '/var/tmp/import.csv' INTO TABLE r_data FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 ROWS (first_name,last_name,a_number,a_id) Error: The used command is not allowed with this MySQL version I have tried this from the mysql command line, phpmyadmin, and a php script, all with the same error. I have changed the local_infile GLOBAL VARIABLE to ON and restarted the mysql service to no avail. There are a lot of ideas on this out there, but I can't seem to put it all together. I was able to run the version of LOAD DATA INFILE, if I placed the same CSV in the root mysql directory, so I know that the CSV information is valid. Thanks for any help.
  3. What I am trying to do is to submit as POST values to database_write.php, from within the while statement. What is happening is I am getting the second row of data every time I change the primary button. Currently database_write.php is just doing print_r($_POST), And my array is always the same, no matter which select box I choose from. How can I get the values to be associated with the row I am currently changing? Any help would be great, thanks. What I have so far: <table class="table table-bordered table-hover"> <thead> <th>Room Number</th> <th>Primary Caregiver</th> <th>Seconday Caregiver</th> </thead> <tbody class="list"> <?php $sql = 'SELECT alarm_device_id, alarm_description, alarm_device_type, notes FROM alarm_device where notes in (\'MSU\') ORDER BY alarm_description'; $retval = mysql_query( $sql, $con ); if(! $retval ) { die('Could not get data: ' . mysql_error()); } $x=0; while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { $id = $row['alarm_device_id']; $alarm_description = $row['alarm_description']; echo '<form id="msu_form">'; echo "<tr><td>{$row['alarm_description']}</td>"; echo "<td>"; $query2 = "SELECT alert_device_id,alert_description FROM alert_device WHERE notes = 'MSU'"; $result2 = mysql_query($query2) or die("Error in alarm_device select:" . mysql_error()); $count2 = mysql_num_rows($result2); if($count2 > 0) { //echo '<select name='.$x.'>'; echo '<select id="Primary" name="primary" onchange="doAjaxPost(this)">'; while($row2 = mysql_fetch_array($result2)) { echo "<option value=".$row2['alert_device_id'].">".$row2['alert_description']."</option>"; } echo "</select>"; }else { echo "Please update alert device to this area"; } echo "</td>"; echo "<td>"; $query3 = "SELECT alert_device_id,alert_description FROM alert_device WHERE notes = 'MSU2'"; $result3 = mysql_query($query3) or die("Error in alarm_device select:" . mysql_error()); $count3 = mysql_num_rows($result3); if($count3 > 0) { echo '<select id="Secondary" name="secondary">'; while($row3 = mysql_fetch_array($result3)) { echo "<option value=".$row3['alert_device_id'].">".$row3['alert_description']."</option>"; } echo "</select>"; }else { echo "Please update alert device to this area"; } echo "</td>"; $aid = $id + $x; //echo $aid; //$ad = $alarm_description + $x; echo '<input type="hidden" id="ID" name="ID" value="'.$id.'"/>'; //echo '<input type="hidden" id="desc" name="desc" value="'.$ad.'"/>'; //echo '<td>'."<input type='submit' name='btnupdate' value='UPDATE' /></td>"; //echo '<td><input type="button" value="Ajax Request" onClick="doAjaxPost()"></td>'; echo '</form>'; $x = $x+1; } ?> <script> function doAjaxPost() { // get the form values var primary = $('#Primary').val(); var secondary = $('#Secondary').val(); var hidden = $('#ID').val(); //var desc = $(sel).parent().nextAll('#desc').val(); $.ajax({ type: "POST", url: "functions/database_write.php", data: $('#msu_form').serialize(), //data: "Primary="+primary+"&Hidden="+hidden+"&Secondary="+secondary, success: function(resp){ //we have the response alert("'" + resp + "'"); }, error: function(e){ alert('Error: ' + e); } }); } </script> </tr> </tbody> </table>
  4. Is there any way to have a field that will update any time its row is updated? My situation is that I will have multiple devices writing to a database, and in one case the time that is being kept track of is important. And the devices writing to the database are a bit difficult to keep accurate times on, so instead of writing the time from the devices themselves, I was hoping I could just have a field update itself. I know it can be done on INSERT, but I do not want to do an INSERT every time. Thanks!
  5. echo '<option value='.$row['ID'].'>'.$row['LastName'].', '. $row['FirstName'].'</option>'; This is part of a select box, so no, I did not have the []. I will use a checkbox instead, that will likely be a better type of input instead, and I will use the [] as you mention. Thank you. I will build the checkbox quickly and check it out.
  6. foreach($_POST['customerID'] as $value) Warning: Invalid argument supplied for foreach() I have used _GET as well, to confirm that there are values for this variable. What am I missing? Thanks
  7. This should be simple, but I can't seem to get it right. I am using a query to select values, it returns a list of 7 results. I would like to use a foreach for those results. Below is how I understand it (at this point just trying to view the results) but I am getting nothing. I am new to arrays and the foreach. $query = "SELECT a FROM table WHERE b IS NULL"; $result = mysql_query($query) or die (mysql_error()); $row = mysql_fetch_array($result); foreach($row['a'] as $value) { echo $value.'<br>'; } Thanks
  8. Is there a reason why IE doesn't just use the word Copy in a URL. It turned it into a copyright symbol? Firefox did not do this. Just wondering if anyone has any idea why.
  9. Table fields are DeviceID and GuardID. Existing in this table are a large number of rows with the same GuardID (49) and I would like to run an insert query to insert the same amount of rows with the same DeviceID's that will have a GuardID of 843. This is what what makes sense to us but it is not working. INSERT INTO DeviceGuard SELECT DeviceID FROM DeviceGuard WHERE GuardID = 49 , 843 Thanks
  10. Thanks Keith!! That query worked perfect.
  11. I am trying to write an update query with a null value. But I continue to get this error: "Incorrect date value: '' for column 'Date_Eng_replied' at row 1" The DB is set to allow Null Values for this field. I have tried defining the variable as Null in a few ways: $replydate = $_GET['replydate']; if($replydate == '') { unset($replydate); } AND $replydate = $_GET['replydate']; if($replydate == '') { $replydate = NULL; } AND $replydate = $_GET['replydate']; if($replydate == '') { $replydate = 'NULL'; } Query if needed $query4 = "UPDATE tblopen_issue_remarks SET Fix = '$fix', Date_Eng_replied = '$replydate', Status = '$status' WHERE ID = '$threadid'"; mysql_query($query4) or die(mysql_error()); None of which will write the Null into the DB
  12. Yeah??? I don't understand, if you replace the OR with an AND the query never results in any records matching. I don't see how the OR is what is causing the problem. Could you show the correct query and assist me by explaining why the OR is throwing it off? Thanks
  13. -- -- Dumping data for table `tbltickets` -- INSERT INTO `tbltickets` (`ID`, `CustomerNumber`, `Contact`, `ContactPhone`, `Extension`, `TroubleID`, `Summary`, `OpenedBy`, `DateOpened`, `Status`, `DateClosed`, `ClosedBy`, `FollowUp`, `DateFollowUp`, `Type`, `warrantyActivity`) VALUES (11490, '000000', 'test', '', '', NULL, 'test test', '1', '2009-02-11 08:55:15', -1, '2009-02-12 12:46:57', '1', 0, NULL, 0, ''), (11491, '000000', 'test', '', '', NULL, 'test', '1', '2009-02-12 13:23:08', -1, '2009-02-24 08:37:50', '1', 0, NULL, 0, ''), (11492, '000000', 'tesfasd', '', '', NULL, 'teate asdf', '1', '2009-02-12 13:23:15', -1, '2009-02-13 12:31:26', '1', 0, NULL, 0, ''), (11493, '000000', 'sdfsdf', '', '', NULL, 'teasdfsd', '1', '2009-02-13 18:33:35', -1, '2009-02-24 08:37:02', '1', 0, NULL, 1, ''), (11494, '500642', 'Steve', '', '', NULL, 'Got a new keypad and needs programming.', '1', '2009-02-23 10:55:46', -1, '2009-02-23 10:56:06', '1', 0, NULL, 0, ''), (11495, '000000', 'teset', '', '', NULL, 'test', '1', '2009-02-24 09:44:17', -1, '2009-02-24 13:53:57', '1', 0, NULL, 0, ''), (11496, '000000', 'Test Test', '', '', NULL, 'Testing with new ticket', '1', '2009-02-24 13:54:15', -1, '2009-02-24 14:00:58', '1', 0, NULL, 0, ''), (11497, '000000', 'Test Name', '2620007458', '', NULL, 'Test ticket number 2. Number 2. Number 2. We are having problems and need it fixed. Run away. Run away.', '1', '2009-02-24 14:04:15', -1, '2009-02-24 14:10:18', '1', 0, NULL, 0, ''), (11498, '000000', 'Test Name', '', '', NULL, 'Test', '1', '2009-02-25 07:54:07', -1, '2009-02-25 08:08:55', '1', 0, NULL, 0, ''), (11499, '000000', 'Test Name', '', '', NULL, 'Test', '1', '2009-02-25 08:09:02', -1, '2009-02-25 09:04:03', '1', 0, NULL, 0, ''), (11500, '000000', 'Test Name', '', '', NULL, 'test', '1', '2009-02-25 10:34:54', -1, '2009-02-25 10:35:42', '1', 0, NULL, 0, ''), (11501, '501089', 'Katie', '', '', NULL, 'Just received new pager and it''s not working.', '1', '2009-02-25 10:44:54', -1, '2009-02-25 10:49:20', '1', 0, NULL, 0, ''), (11506, '000000', 'Test Name', '', '', NULL, 'test', '1', '2009-02-26 09:55:53', 0, NULL, NULL, 0, NULL, 0, ''), (11507, '000000', 'Test Name', '', '', NULL, 'test', '1', '2009-02-26 10:06:56', -1, '2009-02-27 12:54:37', '1', 0, NULL, 1, ''), (11508, '500940', 'Dean', '2003067706', '', NULL, 'Left me a VM. Wants to discuss the conversation that I had earlier with Chris.', '1', '2009-02-27 13:11:50', -1, '2009-02-27 13:46:49', '1', 0, NULL, 0, ''), (11509, '000000', 'Test Name', '', '', NULL, 'test', '1', '2009-02-28 22:41:58', 2, NULL, NULL, 0, NULL, 1, ''), (11510, '000000', 'test', '', '', NULL, 'test proactive', '1', '2009-03-13 07:46:28', 0, NULL, NULL, 0, NULL, 3, ''), (11511, '000000', 'Drew', '4140004757', NULL, NULL, NULL, '2', '2009-03-16 16:18:26', -1, '2009-03-16 00:00:00', NULL, 0, NULL, 3, NULL), (11512, '000000', 'Drew', '4140004757', NULL, NULL, NULL, '2', '2009-03-16 16:18:47', -1, '2009-03-16 00:00:00', NULL, 0, NULL, 3, NULL), (11513, '000000', 'Drew', '4140004757', NULL, NULL, 'ddddddddd', '2', '2009-03-16 16:23:14', -1, '2009-03-16 17:23:14', NULL, 0, NULL, 3, NULL), (11514, '000000', '', '', NULL, NULL, 'sdfasdfasdfasdf\r\nasdfasf\r\nasdf\r\nasdf\r\nasdf\r\n', '2', '2009-03-16 16:26:27', -1, '2009-03-16 17:26:27', NULL, 0, NULL, 3, NULL), (11515, '000000', 'dfasf', '3333333333', NULL, NULL, 'ddddd\r\ndddddd\r\ndddddd\r\ndddddd', '2', '2009-03-16 16:27:15', -1, '2009-03-16 17:27:15', NULL, 0, NULL, 3, NULL), (11516, '000000', 'tttttttt', '4444444444', NULL, NULL, 'dafasdfad\r\ndfasf\r\ndf\r\nasdf\r\nasfd', '2', '2009-03-16 16:37:30', -1, '2009-03-16 17:37:30', NULL, 0, NULL, 3, NULL), (11517, '000000', 'tttttttt', '4444444444', NULL, NULL, 'dafasdfad\r\ndfasf\r\ndf\r\nasdf\r\nasfd', '2', '2009-03-16 16:37:41', -1, '2009-03-16 17:37:41', NULL, 0, NULL, 3, NULL), (11518, '000000', 'tttttttt', '4444444444', NULL, NULL, 'dafasdfad\r\ndfasf\r\ndf\r\nasdf\r\nasfd', '2', '2009-03-16 16:38:25', -1, '2009-03-16 17:38:25', NULL, 0, NULL, 3, NULL), (11519, '000000', 'sdfasdfasd', '4444444444', NULL, NULL, 'afasdfasdf<br />\r\nasfasdf<br />\r\nf<br />\r\nasdf<br />\r\nasdf<br />\r\n', '2', '2009-03-16 16:39:44', -1, '2009-03-16 17:39:44', NULL, 0, NULL, 3, NULL); -- -- Dumping data for table `tblticketmessages` -- INSERT INTO `tblticketmessages` (`ID`, `TicketID`, `Message`, `EnteredBy`, `Date`) VALUES (12282, 11492, 'test', '1', '2009-02-13 08:41:50'), (12283, 11493, 'blah blah', '1', '2009-02-20 14:05:26'), (12284, 11493, 'tests test tests test', '1', '2009-02-20 14:05:47'), (12285, 11494, 'Told him I would fax the programming sheet that we previously created for him. Fax#: (888) 888-2672.', '1', '2009-02-23 10:55:58'), (12286, 11495, 'test test test', '1', '2009-02-24 13:47:47'), (12287, 11495, 'test test test New comment', '1', '2009-02-24 13:50:33'), (12288, 11496, 'Test new remark 1.', '1', '2009-02-24 13:56:29'), (12289, 11497, 'Testing of the function of adding the remarks to the portal. I need to verify that the email is going through as programmed.', '1', '2009-02-24 14:08:31'), (12290, 11498, 'Test escalation', '1', '2009-02-25 07:54:26'), (12291, 11499, 'test', '1', '2009-02-25 08:09:15'), (12292, 11500, 'test test', '1', '2009-02-25 10:34:57'), (12293, 11501, 'Walked her through manually programming the pager. Tested and everything working great.', '1', '2009-02-25 10:49:17'), (12297, 11506, 'test 1', '1', '2009-02-26 09:55:58'), (12298, 11506, 'test 2', '1', '2009-02-26 09:56:25'), (12299, 11507, 'test', '1', '2009-02-26 10:06:59'), (12300, 11507, 'test', '1', '2009-02-26 10:07:02'), (12301, 11508, 'Returned call. Explained why he has to change out the base unit.', '1', '2009-02-27 13:15:14'), (12302, 11509, 'test 11509', '4', '2009-03-04 14:40:58'), (12303, 11509, 'test', '1', '2009-03-13 07:45:24'), (12304, 11510, 'test', '1', '2009-03-13 07:46:31'), (12305, 11506, 'test', '1', '2009-03-13 07:56:33'), (12306, 11506, 'test 2', '1', '2009-03-13 07:57:14'), (12307, 11518, 'dafasdfad\r\ndfasf\r\ndf\r\nasdf\r\nasfd', '2', '2009-03-16 16:38:25'), (12308, 11519, 'afasdfasdf<br />\r\nasfasdf<br />\r\nf<br />\r\nasdf<br />\r\nasdf<br />\r\n', '2', '2009-03-16 16:39:44'); That should do it.
×
×
  • 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.