Jump to content

rugzo

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rugzo's Achievements

Member

Member (2/5)

0

Reputation

  1. Please tell me how to explode and sum a second value in a field if you now... i don't get any errors, i just get a sero "0"
  2. i tried this but no success, it gives me 0 and no errors... "select sum(cast(substring_index('score','_',-1) as binary))...
  3. i just want to sum the second values in the column... 1_3 3_3 3-4 3+3+4=12
  4. hi all, how can i sum the second value in a mysql field after the delimiter? assume i have a column--> xxx 1_34 34_3 23_32 ... i want to sum the value after the "_" delimiter... i tried like that but no success --> "select sum(substring_index('score','_',-1)) from udf...
  5. Hi all, i couldn't find expression for average. There are many of them like sum(array) max(array) but couldn't find something like avg(array) ?
  6. Hi, i have a row which should be updated by every query. id sum 0 1 every time i run the query it should update the sum plus the new value. update x set sum = sum + $newvalue. this works fine. but how can i do that with explode. i need this because this column has to values which are seperated with "_". like 120_140. is it possible with sql query that i can do that. as example the current values are 120_140 the new values are 10_5 = 120+10_140+5 130_145 ? i know i can do that with php easyly but it must be done via the sql query in my structure ? thanks...
  7. Hi, if i execute this command --> $query= mysql_query("ALTER TABLE `ana` DROP COLUMN `sdfsd`"); it drops the column but gives me the error --> Unknown column 'sdfsd' in 'ana' Has anyone a clue why i get this error even it drops the column??
  8. rugzo

    Field order

    is there any chance to update the field order?
  9. rugzo

    Field order

    Hi all, i built an interface which produces forms and near by also the sql databases for the forms. The forms have categories and items. My problem is when its build the form i can not relate the items to the categories. example--> cars ford bmw motors yamaha honda ... lets assume i built this form which also built the database. The database looks then like this--> id cars ford bmw motors yamaha honda if the order would never change i would have no problem but if i add or remove items and categories via the interface after i built the form it will add them after the last column. If i would now add another car it would it put after the last item "honda". I have only 2 chances. a) is it possible to tell sql that ford and bmw are the items of the category car? b) as my interface works dynamically and in a specific order it could change the order again after i submit the changes. If you add an item you have the possibility to say after which column ---> ALTER TABLE `test`.`yeni1` ADD COLUMN `df` VARCHAR(45) NOT NULL AFTER `kkkk`;... Is there also a command which updates the please of the field? one of them could solve my problem, please help... thanks in advance...
  10. Thanks for the reply. Assume i have a table in mysql like --> id inputvolume name 0 5 john 1 4 mike 2 3 john 3 5 mike ... and i have a page which should connect to database and read it--> name volume john echo ... mike echo... how can i do that the page will connect to database and read the data? don't misunderstand me, i can make the connection via php and read the data this is no problem via ususal meta refresh but i don't have a clue how its done via ajax...
  11. Hi All, for every person the page should get data from mysql and display it on the page without any onchange, onclick or input... i have a form where persons make entries which are submitted to mysql and i want to see them all in another page. So it simply will get data from mysql every second without f5. is this possible and can you give me a lead? thanks...
  12. ok i got it <code><html> <head> <script language="JavaScript"> <!-- var clockID = 0; var saniye = 00; var dakika = 00; var saat = 00; function UpdateClock() { if(clockID) { clearTimeout(clockID); clockID = 0; } saniye ++; if(saniye <= 9) { var saniye_yaz = "0" + saniye ; }else{ var saniye_yaz = saniye ; } if (saniye > 59) { dakika ++; saniye = 0; saniye_yaz ="00"; } if(dakika <=9) { var dakika_yaz = "0" + dakika ; }else{ var dakika_yaz = dakika ; } if(dakika > 59) { saat ++; dakika = 0; dakika_yaz = "00"; } if(saat <=9) { var saat_yaz = "0" + saat ; }else{ var saat_yaz = saat ; } if(saat>=24) { saat=0; dakika=0; saniye=0; } document.theClock.theTime.value = saat_yaz + ":" + dakika_yaz + ":" + saniye_yaz; document.title = saat_yaz + ":" + dakika_yaz + ":" + saniye_yaz; clockID = setTimeout("UpdateClock()", 1000); } function StartClock() { clockID = setTimeout("UpdateClock()", 500); } function KillClock() { if(clockID) { clearTimeout(clockID); clockID = 0; } } //--> </script> </head> <body onLoad="StartClock()" onUnload="KillClock()"> <center> <form name="theClock"><input name="theTime" size="8" type="text"> </form> </center> </body> </html></code>
  13. Hi All, i have a code which shows the clock. But i want to use it as a counter like a kronometre. It simply will start to count from zero if the page is refreshed. That i managed but i couldn't make it to count from zero. I know that something like below x = new date() ; y = new date(), start = x - y... but couldn't do it since my java knowledge is not enough. I will implement this into my php page. Can someone please help. It just has to start from 00:00:00 <html> <head> <script language="JavaScript"> <!-- var clockID = 0; function UpdateClock() { if(clockID) { clearTimeout(clockID); clockID = 0; } var tDate = new Date(); if((tDate.getSeconds())<=9) { document.theClock.theTime.value = "" + tDate.getHours() + ":" + tDate.getMinutes() + ":0" + tDate.getSeconds(); document.title = "The time is: " + tDate.getHours() + ":" + tDate.getMinutes() + ":0" + tDate.getSeconds(); } else if((tDate.getMinutes())<=9) { document.theClock.theTime.value = "" + tDate.getHours() + ":0" + tDate.getMinutes() + ":" + tDate.getSeconds(); document.title = "The time is: " + tDate.getHours() + ":0" + tDate.getMinutes() + ":" + tDate.getSeconds(); } else if(((tDate.getSeconds())<=9) && ((tDate.getMinutes())<=9)) { document.theClock.theTime.value = "" + tDate.getHours() + ":0" + tDate.getMinutes() + ":0" + tDate.getSeconds(); document.title = "The time is: " + tDate.getHours() + ":0" + tDate.getMinutes() + ":0" + tDate.getSeconds(); } else { document.theClock.theTime.value = "" + tDate.getHours() + ":" + tDate.getMinutes() + ":" + tDate.getSeconds(); document.title = "The time is: " + tDate.getHours() + ":" + tDate.getMinutes() + ":" + tDate.getSeconds(); } clockID = setTimeout("UpdateClock()", 1000); } function StartClock() { clockID = setTimeout("UpdateClock()", 500); } function KillClock() { if(clockID) { clearTimeout(clockID); clockID = 0; } } //--> </script> </head> <body onload="StartClock()" onunload="KillClock()"> <center> <form name="theClock"><input name="theTime" size="8" type="text"> </form> </center> </body> </html>
  14. i thought that since the time section includes the month, it would understand it or it should be a way that mysql should understand that 2009-07-03 is an entry in July and 2009-july also?
×
×
  • 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.