Jump to content

shashib

Members
  • Content Count

    45
  • Joined

  • Last visited

Community Reputation

0 Neutral

About shashib

  • Rank
    Newbie

Profile Information

  • Location
    India
  1. any one here ....only my UPDATE QUERY IS NOT WORKING ... SELECT QUERY IS PERFECT ...IT TAKES ME IN IF CONDITION IF == else it take me in else loop update producttab set prdname='prdnew' WHERE prdid='00A' update producttab set prdname='prd2new' WHERE prdid='00B' this is what echo/print my update query shows....but in database value is not update ....
  2. I need to check if value inserting in database while **import excel file** , if it has already value in database then it should get update. Below is producttab table value in database prdid | prdname 00A | prd1 00B | prd2 00C | prd3 00D | prd4 Below is EXCEL FILE data prdid | prdname 00A | prdnew 00B | prd2new 00E | prd8 00H | prd9 So if i upload above excel file then , 00A , 00B should get UPDATE IN producttab table as they are already present there... but 00E,00H should get insert below is what i have tried, value is
  3. Its PHP MYSQL : I have a table prodt , in which i first INSERT a value and with its LAST INSERT ID i do update for MAX + 1 as below , BUT I AM GETTING ERROR You can't specify target table 'prodt' for update in FROM clause $a = db_insert_id(); $sqllast = "UPDATE prodt SET pdname= ((SELECT pdname FROM ( SELECT MAX( pdname ) AS pdname FROM prodt WHERE oid = ".db_escape($oid)." ) AS pdname ) + 1 ), pcyn = ".db_escape(0)." WHERE id = ".db_escape($a)." AND oid= ".
  4. hey dude, And what if i need as below, as i tried to build in your above query ...but i failed ..... id | mid | wgh | remark| remkok | name | 1 3 1.5 r3ok 1 name1 2 2 1.5 0 name3 3 2 0.6 nice 0 name3 4 1 1.2 okh 0 name4 5 4 1.5 bye 0 name2 6 4 2.4 okby 0 name2 7 3 3.0 oknice 1 name1 mid wgh 3 1.5 3.0 remarks : NAME1 - r3ok, oknice 4 1.5 2.4 remarks : NAME2 - bye, okby 2 1.5 0.6 remarks : NAM
  5. hey @dsonesuk, thanks you very much , have tried your above code ....and its working ... will implement it fully with my all conditions .... thanks once again
  6. hey @dsonesuk , thanks for reply ... please help me out what you have in mind ...might it can help me ...basically that remarks row will be seen only when my Column remkok = 1 ... but to explain each point was making my question confusing ..hence i wrote it simple.... please help me with your answer Thanks
  7. i have modified my question ..please see
  8. any one here ..please help me ...any other solution with other table tr format will help me tooo
  9. Below is products table : id | mid | wgh | remark| remkok | 1 3 1.5 r3ok 1 2 2 1.5 0 3 2 0.6 nice 0 4 1 1.2 okh 0 5 4 1.5 bye 0 6 4 2.4 okby 0 7 3 3.0 oknice 1 I want to display remark below tr of group by mid ....like below mid wgh 3 1.5 3.0 remarks : r3ok, oknice 4 1.5 2.4 remarks : bye, okby 2 1.5 0.6 remarks : , nice 1 1.2 remarks : okh **What i have tried as
  10. hey thanks for concepts ... NO range is also in system ...please SEE UPDATE QUESTION : Here is main excel file : but the thing is that value 26,25.30 is in excel file .... let say i make tree node for AB and XE and others as you said ....but what about value ...how i will call that from excel file ...how i can differentiate that 26 belong to which tree node from excel file. As said early that excel file has many boxes ( as per your logic : many others node and its value ) combinations , above is just sample .... i think node logic is nice ... but after that which val
  11. Above Code box is data which is in excel in same way as i have shown ... in PHP page i have below drop-down value 1 } 0.45-0.90 ( range ) : thats 0.45,0.55,0.69,..0.90 2 } AB , XE 3 } A,B,C,D 4 } b1,b2,b3,X1,X2,X3 When any one select 0.45 - AB - A - b1 :: then its value should come from excel or any other matter(mysql etc) : 23 i cant make each combination and store in database, as there are thousands of combination , so is there any easy way that excel format get store in mysql or any coding etc... i haven't tried anything ..as i am not getting how to start an what to start
  12. Any with solution .....
  13. any one here ?????
  14. ------------------------------|------------------ AB | XE ------------------------------|------------------ | b1 | b2 | b3 | X1 | X2 | X3 ------------------------------|------------------ | A | 23 | 34 | 45 | 20 | 19 | 80 0.45 - 0.90| B | 20 | 31 | 85 | 23 | 23 | 67 | C | 23 | 32 | 23 | 10 | 12 | 23 | D | 10 | 12 | 23 | 56 | 45 | 23 -----------------------------|------------------ AB | XE ------------------------------|------------------ | b1 | b2 | b3 | X1 | X2 | X3 ----
  15. id | mid | pid | owgh | nwgh |1 3 12 1.5 0.62 3 12 1.5 0.33 3 14 0.6 0.44 3 15 1.2 1.15 4 16 1.5 1.06 4 17 2.4 1.27 3 19 3.0 1.4 Select mid , COUNT(distinct pid) as cpid , SUM(nwgh) as totalnwgh from test GROUP BY mid sqlfiddle : link of below result with above query mid cpid totalnwgh3 4 3.84 2 2.2 But above i need one more column that's as below : **totowgh** mid cpid totalnwgh totowgh3 4 3.8 6.3 (DISTINCT value as per pid column)4 2 2.2 3.9 where totowgh
×
×
  • Create New...