Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by funbinod

  1. hello! is here any discussion forum for android application development? or can i just share my problems on JAVA forum??
  2. thank you for the reply. i already tried to put the position of selected row using "index". but that also returned same problem. but now i solved the problem with a slight change on the above code. i just replaced ------------ .data("selected", 'Y') to .attr("data-selected", 'Y')
  3. hello all i am trying to use 'keydown' function to move through html rows. but i could not succeed. here is what i tried-- $("body").on("keyup", function(e) { if ($("#mid").find(".maintable tr[data-selected='Y']").length == 0) { $("#mid").find(".maintable tr").first().data("selected", 'Y').addClass("thisrow"); } else { if (e.which === 40) { $("#mid").find(".maintable tr[data-selected='Y']").next().data("selected", 'Y').addClass("thisrow"); $("#mid").find(".maintable tr[data-selected='Y']").first().data("selected", 'N').removeClass("thisrow"); } else if (e.wh
  4. thank u for the replay. it worked. its great suggestion. thank u again.
  5. hello all! i'm trying something for binding parameters to a prepared statement like below. $tbl = 'stock'; $cols = 'icode=?, item=?, catid=?, description=?, unitid=?, pprice=?, sprice=?, oqty=?, oprice=?, oamt=?, bcode=?'; // $vals = "'101', 'ASUS H61M-E', 'abcde', '2', '1', '5300.00', '6500.00', '11', '5300', '55528', '101'"; $vals = "101, ASUS H61M-E, abcde, 2, 1, 5300.00, 6500.00, 11, 5300, 55528, 101"; $uq = $mysqli->prepare("UPDATE $tbl SET $cols WHERE $whcol='$whval'"); if (!$uq) { $msg = "Error1: $mysqli->error!"; } else { $uq->bind_param('sssssssssss', $vals); // t
  6. i found that what i learnt so far is also wrong. i corrected the aforementioned code like this $cuidstmt = $pgsql->prepare("SELECT cid, uid FROM user WHERE name=?"); if(!$cuidstmt) { echo "Error: " . $pgsql->errorInfo()[2]; } else { $cuidstmt->execute(array($u)); $cuidstmt->execute(); $cuidstmt->fetch(); } but i still couldn't understand how can i get the result(s). where can i get the data from 'cid' and 'uid' columns mentioned in the prepared statement. thank u all in advance.
  7. hello all! i'm learning postgresql. i was just trying to fetch some data using prepared statement. but found that it is quiet different than mysql. the all i learnt searching on the web is this. $cuidstmt = $pgsql->prepare("SELECT cid, uid FROM user WHERE name=?"); if(!$cuidstmt) { echo "Error: " . $pgsql->errorInfo()[2]; } else { $cuidstmt->bindParam('i', $u); $cuidstmt->execute(); $cuidstmt->fetch(); } but i could not understand how can i print the required data. where the data is stored. just like in mysqli we can bind result on a string, how ca
  8. hello all. i was just wondering between these two versions of PHP - 5 & 7. right now i'm practicing on if PHP 5. and now i'm thinking of upgrading to PHP 7. and i want to know if my current code works with the new version or not. if i upgraded my PHP to 7, should i need to change all or some parts of the codes? thank you in advance.
  9. funbinod

    mysql audit trial

    hello all! i was wandering through web to learn about audit trial. but could not find anything from where i can understand this clearly. can anyone please tell me in details about this??? for nowm i want to know two things: 1) is this automatically done by mysql as it's feature or this is my job to maintain the complete activity??? 2) if this is a mysql feature, is this available on all versions??? thank you in advance...
  10. this hint solved my problem. i cheated the code like below. .......... AND projtype IN (SELECT id FROM projcat WHERE under=1 UNION SELECT id FROM projcat WHERE id=1 UNION SELECT id FROM projcat WHERE under IN (SELECT id FROM projcat WHERE under=1)) thank u very very much...
  11. thank you for the reply. but it banged my head. this is beyond my practice and is very tough to understand. can't it be done with a simple modification to my code???? like........ .......... AND projtype IN (1, SELECT id FROM projcat WHERE under=1 UNION SELECT id FROM projcat WHERE under IN (SELECT id FROM projcat WHERE under=1)) thank u again.
  12. hello all! i am struggling with a problem in mysql. i want to select all rows from a table with an id and its child ids. i tried the following ............... AND projtype IN (SELECT id FROM projcat WHERE under=1 UNION SELECT id FROM projcat WHERE under IN (SELECT id FROM projcat WHERE under=1)) it works. But this selects rows that matched the child ids only. i want to select all the rows which use the parent id also (i.e. '1' on the given example). please help me with some hints. thanks in advance....
  13. hi all! after long time i'm back here with a problem. i want to select all data attributes from a div with its name and value using jquery each function use that elsewhere. here is the html for the div. <div class='EW' data-rowid='1' data-unit='' data-workdesc='description' data-vby='2' data-distanceTot='50' data-AVcutTot='500' data-VcutTot='25000'></div> and i tested the following to get my result. var datas = $(".EW").attributes; $.each(datas, function(i,item) { $("#msg").text(item.name + ":" + item.value); }) but i could not get any result. can u
  14. thank u. this suggestion solved the problem var remove = []; for (i=enclass; i<=12; i+=enclass) { remove.push(i); } if ($.inArray(parseInt($(this).parent("td").attr("class")), remove) == -1) { $(this).remove(); }
  15. hello all! i was trying to do a for loop to remove all elements that does not meet the for loop. following is the code i tried. $("#feetable input").each(function(e) { var thisvalue = $(this).val(); var enclass = 3; var i; for (i=enclass; i<=12; i+=enclass) { if ($(this).parent("td").attr("class") == i && $(this).val() == thisvalue) { $(this).remove(); } } }) and here is the html <td class='1'><input type='checkbox' /></td> <td class='2'><input type='checkbox' /></td> <td class='3'><input type='checkbox' />&
  16. wow! this solved the problem. i checked for all the tables and found some columns be empty that led to this problem. i corrected them and found that the above code is working properly. thank u for the idea.
  17. thank u for the reply. and sorry for the undefined table screenshots. here i'm again posting the screenshot with some markings. my purpose of this practice is to change the underlined part of the data before copying and the calculation (math) is for that purpose. i'm copying the bordered 4 rows and the math should be applied for all the rows. but it inserted all the rows but only one row with data and rest NULL. and one more thing. i tried to shorten the code and found some interesting results. the following code inserted all the rows with data INSERT IN
  18. thank u for the reply. but if my explanation above was unclear i again explain - columns with data also converts to NULL except one row. you can check those two screenshots.
  19. i was trying to insert rows from one table to another and edit values before inserting. for that i did the following INSERT INTO projectra (projid, nermid, name, code, per, unitper, description, materials, manerials, macerials) SELECT '$projid', fullid, name, code, per, unitper, description, REPLACE (materials, SUBSTRING_INDEX(materials, ';', -1), ( (SELECT (lurate) FROM items WHERE fullid=SUBSTRING_INDEX(materials, ';', 1)) + ( (SELECT uweight FROM items WHERE fullid=SUBSTRING_INDEX(materials, ';', 1)) * (SELECT rate FROM transport WHERE name=(CONCAT((SELECT ctype FROM i
  20. PHP error is enabled. and there is nothing added on error log of my cpanel. the only thing happens when i post the csv file is - "Aw, Snap" page. its so much confusing. it works very fine when i use LOAD DATA method.
  21. i've posted the screenshot. it just displays "Aq, Snap!" DEV TOOLS also disconnects. and yes! the file upload is done through jQuery ajax. when i check manually, the file uploads but the mysql inserting part is not executed. and i found some mistakes on my code. i corrected it as following. but it still is not performing the action. $q = $mysqli->prepare("INSERT INTO projects (name, ctrtype, budhead, code, wardno, govallo, startdate, enddate, fy, cid, uid) VALUES (?,?,?,?,?,?,?,?,?,?,?)"); if (!$q) { echo "<div id='success'>NO&l
  22. because i want to filter data supplied in the csv file.
  23. hello all! i am trying to upload and insert data on a csv file to mysql. it uploads but could not insert data to mysql. following is the work i've done. $handle = fopen($targetpath, 'r'); $firstline = true; while (($data = fgetcsv($handle, 5000, ',')) !== FALSE) { if (!$firstline) { $continue = true; if ($data[0] == "" && $data[1] == "" && $data[2] == "" && $data[3] == "" && $data[4] == "" && $data[5] == "" && $data[6] == "" && $data[7] == ""){ $continue = false; } if (strlen($
  24. tr:nth-child(4n) {page-break-after: always;} this didnot work as expected
  25. hello all! i was trying to set page break while printing my html page after every 4 table rows. can anyone guide me??? thanks in advance.
  • Create New...