Jump to content

alin19

Members
  • Posts

    334
  • Joined

  • Last visited

    Never

Everything posted by alin19

  1. there is another colum colled id autoincremented
  2. i'm not sure that it will work, but you can try this: <select name="Type" class="000"> <option value="------">------</option> <option value="Game" >GAME</option> <option value="DVD" >DVD</option> <option value="CD" >CD</option> </select>
  3. i'm trying to use this query: SELECT * FROM `op_tranzactionare` GROUP BY `id_bo` to get the last record for each id_bo by i get the first record for each one, what can i do? id_bo se28 2008-03-22 SIF1 SELL 2.7000 1000 0.50 0.00 FL15 2008-03-22 SIF1 BUY 99.9999 12 9.99 0.00 FL15 2008-03-22 SIF1 SELL 0.0000 0 0.00 0.00 FL15 2008-03-22 BRD SELL 18.5000 1000 0.50 18607.30 FL15 2008-03-22 SIF1 BUY 0.0000 0 0.00 0.00 FL15 2008-03-22 SIF1 SELL 0.0000 0 0.00 0.00 FL15 2008-03-23 SIF1 SELL 0.0000 0 0.00 0.00 MM36 2008-03-22 TLV BUY 1000.0000 0 1.00 594.00 yu21 2008-03-22 TLV BUY 1000.0000 2000 1.00 1980000.00 yu21 2008-03-22 SIF3 SELL 1.6000 11111 1.00 17969.60
  4. let's say that i have something like this: <?php $x=date ("Y-m-d"); $y=date ("2008-03-24"); if ($x<$y) echo "$y is in the future"; ?> how can i do something like this?
  5. can you explain a little the code? what is 7776000? i could have 120 days; 90 days was just an example
  6. i'm trying to make a script and i stumbled on a problem i have 2 insert spaces first: doday's date: ex 19.03.2008 second: number of days: ex 90 and i want to insert in a data base the day that will be aftern 90 days: ex 18.06.2008
  7. i wish to make some conexion, when inserting in a table some values, some of them to be also inserted in the second one, the same with the update, can you explain to me how can i pull the the data when i have the 2 tables linked? table 1 table2 id nume id prenume with: select * from 'table 1' i will get nume and prenume?
  8. i'm using phpmyadmin would this work? table 1: CREATE TABLE `ion` (`id` INT( 2 ) NOT NULL ,`test` VARCHAR( 2 ) NOT NULL ,PRIMARY KEY ( `id` ) ) table 2: CREATE TABLE `ion2` (`id_test` INT( 2 ) NOT NULL ,`id` VARCHAR( 2 ) NOT NULL ,PRIMARY KEY ( `id` ))
  9. let me explain more detailed: i have a txt file on the server that contains a text : test test test test and i want the clients do download this text file, if the insert the adress of the text file: localhost/test.txt the browser writes : test test test test (exactly what is in the text file)
  10. how can i create a link for a download? i usualy used exactly the adres of the file, but i have a txt file and the instead of downloading it shows the file in the webpage
  11. but i not exactly what i need. i need something like this: first page----execute --------------------secont page(wait 3 seconds)-----------------------third page
  12. i have 3 pages: first with a form and when the buton is pressed to button to go to the second page second page to be shown only 10 seconds the second page and then go automaticly to the third, from the first to the second i know how to do, but i don't know how to pass to the third
  13. here are all the cods from a minute: 11:20:00 0 RGBS DAFR 2,700 0.3410 0.3420 20,000 - 0.3410 - 2008-01-23 11:20:04 0.00 1 RGBS VESY 20,000 0.1580 0.1600 2,900 1,000 0.1600 1 2008-01-23 11:20:05 0.00 1 RGBS ALBZ - - - - 35,100 0.4930 4 2008-01-23 11:20:06 0.82 1 RGBS ALBZ - - - - 100 0.4920 1 2008-01-23 11:20:06 0.61 1 RGBS ALBZ 800 0.4900 0.4950 26,300 29,800 0.4900 3 2008-01-23 11:20:06 0.20 0 RGBS DAFR 12,700 0.3410 0.3420 20,000 - 0.3410 - 2008-01-23 11:20:07 0.00 0 REGS TLV 523,900 0.7250 0.7300 26,400 - 0.7300 - 2008-01-23 11:20:07 1.39 1 REGS BRD 1,210 20.3000 20.4000 2,270 1,500 20.3000 1 2008-01-23 11:20:09 1.50 0 REGS SIF5 13,800 3.4800 3.4900 4,100 - 3.4800 - 2008-01-23 11:20:09 0.87 0 REGS IMP 100 0.3350 0.3360 10,000 - 0.3400 - 2008-01-23 11:20:09 1.80 1 RGBS PRSN 2,420 21.2000 21.5000 500 1,000 21.5000 1 2008-01-23 11:20:09 -1.83 0 REGS SIF2 100 2.6900 2.7000 29,400 - 2.6900 - 2008-01-23 11:20:10 1.13 1 RGBS ARAX 200 0.2390 0.2400 43,600 1,000 0.2400 1 2008-01-23 11:20:11 1.27 1 REGS BRD 1,160 20.3000 20.4000 2,270 50 20.3000 1 2008-01-23 11:20:11 1.50 1 RGBS ARAX 200 0.2390 0.2400 40,600 3,000 0.2400 1 2008-01-23 11:20:12 1.27 1 RGBS PRSN 2,420 21.2000 21.5000 470 30 21.5000 1 2008-01-23 11:20:12 -1.83 0 REGS BRK 4,400 2.1100 2.1200 1,700 - 2.1200 - 2008-01-23 11:20:13 3.41 0 REGS SIF1 4,100 2.7200 2.7300 4,000 - 2.7400 - 2008-01-23 11:20:14 1.48 0 REGS BRK 4,400 2.1100 2.1200 1,800 - 2.1200 - 2008-01-23 11:20:21 3.41 0 REGS SIF3 38,000 1.7500 1.7700 300 - 1.7500 - 2008-01-23 11:20:22 0.00 1 REGS SIF4 9,200 1.8200 1.8300 10,100 1,300 1.8200 2 2008-01-23 11:20:22 -0.55 0 REGS BRD 1,260 20.3000 20.4000 2,270 - 20.3000 - 2008-01-23 11:20:23 1.50 0 ODBS ARTE 0 0.0000 11.2000 5 - 11.0000 - 2008-01-23 11:20:24 0.00 1 REGS SIF1 1,400 2.7200 2.7300 4,000 2,700 2.7200 2 2008-01-23 11:20:25 0.74 1 REGS SIF2 1,100 2.6800 2.6900 19,900 100 2.6900 1 2008-01-23 11:20:27 1.13 1 XMBS FERO 200 0.5500 0.6000 262 321 0.6000 2 2008-01-23 11:20:31 0.00 1 REGS TLV 523,900 0.7250 0.7300 25,900 500 0.7300 1 2008-01-23 11:20:31 1.39 1 REGS BIO 13,000 0.4480 0.4490 71,500 8,000 0.4480 1 2008-01-23 11:20:32 -0.22 1 REGS OLT 2,700 0.9950 1.0000 500 1,000 1.0100 1 2008-01-23 11:20:32 2.02 0 REGS TLV 522,900 0.7250 0.7300 25,900 - 0.7300 - 2008-01-23 11:20:32 1.39 0 REGS SIF2 1,100 2.6800 2.6900 26,900 - 2.6900 - 2008-01-23 11:20:33 1.13 1 REGS RRC - - - - 67,000 0.0831 2 2008-01-23 11:20:36 -1.89 1 REGS RRC 50,000 0.0826 0.0830 651,000 62,000 0.0830 2 2008-01-23 11:20:36 -2.01 0 REGS BRK 4,400 2.1100 2.1200 5,800 - 2.1200 - 2008-01-23 11:20:37 3.41 1 XMBS SCTB 5 29.0000 30.0000 59 1 30.0000 1 2008-01-23 11:20:39 7.91 1 UNLS NVL 550,900 0.0300 0.0400 734,506 6,500 0.0300 1 2008-01-23 11:20:40 0.00 0 REGS SIF2 1,000 2.6800 2.6900 26,900 - 2.6900 - 2008-01-23 11:20:40 1.13 0 REGS BRK 4,900 2.1100 2.1200 5,800 - 2.1200 - 2008-01-23 11:20:41 3.41 1 XMBS FERO - - - - 200 0.5500 1 2008-01-23 11:20:42 -8.33 1 XMBS FERO 5,638 0.5200 0.6900 13,400 62 0.5200 1 2008-01-23 11:20:42 -13.33 1 REGS TLV 522,900 0.7250 0.7300 15,900 10,000 0.7300 1 2008-01-23 11:20:43 1.39 1 REGS BIO 5,000 0.4480 0.4490 71,500 8,000 0.4480 2 2008-01-23 11:20:43 -0.22 1 REGS TLV 522,900 0.7250 0.7300 12,900 3,000 0.7300 1 2008-01-23 11:20:44 1.39 1 REGS TLV 522,900 0.7250 0.7300 12,700 200 0.7300 1 2008-01-23 11:20:44 1.39 1 REGS SIF3 29,000 1.7500 1.7700 300 9,000 1.7500 1 2008-01-23 11:20:45 0.00 1 REGS SIF4 9,200 1.8200 1.8300 9,600 500 1.8300 2 2008-01-23 11:20:45 0.00 1 REGS TLV 682,500 0.7200 0.7250 77,100 522,900 0.7250 17 2008-01-23 11:20:46 0.69 0 REGS TEL 240 32.2000 32.7000 40 - 32.2000 - 2008-01-23 11:20:47 0.00 1 REGS EFO - - - - 1,000 1.5700 1 2008-01-23 11:20:48 -1.26 1 REGS EFO 1,000 1.5300 1.5500 1,000 1,000 1.5500 1 2008-01-23 11:20:48 -2.52 1 RGBS PRSN 2,420 21.2000 22.2000 50 470 21.5000 1 2008-01-23 11:20:49 -1.83 0 RGBS PRSN 470 21.5000 22.2000 50 - 21.5000 - 2008-01-23 11:20:49 -1.83 0 RGBS PRSN 470 21.5000 22.1000 50 - 21.5000 - 2008-01-23 11:20:50 -1.83 1 XMBS AUCS 100 20.1000 20.5000 37 6 20.2000 1 2008-01-23 11:20:50 6.88 0 REGS TLV 682,500 0.7200 0.7250 80,100 - 0.7250 - 2008-01-23 11:20:54 0.69 0 RGBS ARDF 29,000 0.1120 0.1160 40,000 - 0.1120 - 2008-01-23 11:20:55 0.90 1 REGS BIO 300 0.4450 0.4480 2,000 5,000 0.4480 2 2008-01-23 11:20:55 -0.22 1 REGS BRD 760 20.3000 20.4000 2,270 500 20.3000 3 2008-01-23 11:20:56 1.50 1 REGS BRD 5,010 20.2000 20.3000 240 760 20.3000 2 2008-01-23 11:20:57 1.50 1 REGS SIF4 9,200 1.8200 1.8300 9,100 500 1.8300 1 2008-01-23 11:20:58 0.00 for each simbol i select the ones i need: let's say simbol=SIF1 1 REGS SIF1 1,400 2.7200 2.7300 4,000 2,700 2.7200 2 2008-01-23 11:20:25 0.74 0 REGS SIF1 4,100 2.7200 2.7300 4,000 - 2.7400 - 2008-01-23 11:20:14 1.48 but i only take those that has 1 in the first column 1 REGS SIF1 1,400 2.7200 2.7300 4,000 2,700 2.7200 2 2008-01-23 11:20:25 0.74 here could be more lines but from this one i get this: <ticker>,<per>,<date>,<time>, <open>, <high>, <low>, <close>, <volume>,<openint> SIF1,I,01/23/2008,11:20:00, 2.7200, 2.7200, 2.7200, 2.7200, 2700,0
  14. 1 REGS SIF1 5,200 2.7300 2.7400 3,300 4,800 2.7300 2 2008-01-23 11:22:18 1.11 1 if there is one this line will be considered, the 0 are not REGS omited SIF1 simbol that is search for ... .. . . omited 4800 volum (this will be aded to the rest of the volume made in this minute) 2.7300 prize, (from wich i select open,close,min,max) 2008-01-23 11:22:18 date and time; 11:28:18 is the time, and it will be inserted in an array and then will be created data for the minute 11:28:00 with the help of this row
  15. i the file that needs to be modified are a lot of simbols, one of them is ARAX, another one SIF1 in every minutes for every simbol are a lot of tranzaction, i select all the tranzaction for more simbols and for every minute I create a open,maxim,minim,close and a total volume in that minute but i just need to look on the code and see if can be inproved
  16. it takes a file that contains data like this: 0 RGBS ARAX 40,000 0.2400 0.2400 6,000 - 0.0000 - 2008-01-23 09:30:01 0 0 REGS COS 300 6.4000 6.4000 300 - 0.0000 - 2008-01-23 09:30:02 0 0 REGS SIF3 11,000 1.7100 1.7500 4,200 - 0.0000 - 2008-01-23 09:30:10 0 0 REGS TLV 28,000 0.7200 0.7200 300 - 0.0000 - 2008-01-23 09:30:15 0 0 REGS OIL 1,700 0.7250 0.7700 2,800 - 0.0000 - 2008-01-23 09:30:19 0 0 REGS TLV 28,000 0.7200 0.7000 300 - 0.0000 - 2008-01-23 09:30:20 0 0 REGS SNP 72,000 0.4080 0.4120 100 - 0.0000 - 2008-01-23 09:30:24 0 0 REGS TUFE 6,000 0.7500 0.7300 500 - 0.0000 - 2008-01-23 09:30:25 0 0 REGS BIO 200 0.4490 0.4580 20,000 - 0.0000 - 2008-01-23 09:30:26 0 0 REGS BRK 2,300 2.0600 2.0600 2,000 - 0.0000 - 2008-01-23 09:30:29 0 0 RGBS VESY 20,000 0.1580 0.1620 8,000 - 0.0000 - 2008-01-23 09:30:30 0 0 REGS RRC 12,700 0.0847 0.0830 2,000 - 0.0000 - 2008-01-23 09:30:30 0 0 REGS SIF4 2,000 1.8100 1.8400 11,900 - 0.0000 - 2008-01-23 09:30:31 0 0 REGS BRK 5,000 2.0800 2.0600 2,000 - 0.0000 - 2008-01-23 09:30:33 0 0 REGS SIF3 1,600 1.7600 1.7500 4,200 - 0.0000 - 2008-01-23 09:30:35 0 0 RGBS ALBZ 600 0.4900 0.4950 10,000 - 0.0000 - 2008-01-23 09:30:36 0 0 REGS SIF4 1,700 1.8300 1.8400 11,900 - 0.0000 - 2008-01-23 09:30:39 0 0 REGS SIF1 100 2.6600 2.6000 1,700 - 0.0000 - 2008-01-23 09:30:41 0 and turn it into something like this: <ticker>,<per>,<date>,<time>,<open>,<high>,<low>,<close>,<volume>,<openint> SIF1,I,01/23/2008,10:00:00,2.8000,2.8000,2.7800,2.7800,98500,0 SIF1,I,01/23/2008,10:01:00,2.7800,2.8000,2.7800,2.7800,67000,0 SIF1,I,01/23/2008,10:02:00,2.7800,2.8000,2.7800,2.8000,7500,0 SIF1,I,01/23/2008,10:03:00,2.7900,2.7900,2.7900,2.7900,10000,0 SIF1,I,01/23/2008,10:04:00,2.7900,2.8000,2.7800,2.8000,1200,0 SIF1,I,01/23/2008,10:05:00,2.7900,2.7900,2.7900,2.7900,1000,0 SIF1,I,01/23/2008,10:06:00,2.7800,2.7800,2.7700,2.7700,36900,0 SIF1,I,01/23/2008,10:07:00,2.7700,2.7800,2.7700,2.7800,17400,0 SIF1,I,01/23/2008,10:08:00,2.7400,2.7900,2.7400,2.7800,39923,0 SIF1,I,01/23/2008,10:09:00,2.7700,2.7700,2.7700,2.7700,1900,0 SIF1,I,01/23/2008,10:10:00,2.7700,2.7700,2.7700,2.7700,500,0 SIF1,I,01/23/2008,10:11:00,2.7700,2.7700,2.7700,2.7700,7600,0 SIF1,I,01/23/2008,10:12:00,2.7800,2.7800,2.7800,2.7800,10000,0 SIF1,I,01/23/2008,10:13:00,2.7800,2.7800,2.7800,2.7800,10800,0 SIF1,I,01/23/2008,10:14:00,2.7800,2.7800,2.7200,2.7800,1596,0 SIF1,I,01/23/2008,10:15:00,2.7400,2.7800,2.7400,2.7800,323,0 SIF1,I,01/23/2008,10:16:00,2.7800,2.7800,2.7700,2.7700,8500,0 SIF1,I,01/23/2008,10:17:00,2.7700,2.7700,2.7600,2.7600,1600,0 SIF1,I,01/23/2008,10:18:00,2.7000,2.7700,2.7000,2.7700,182,0 SIF1,I,01/23/2008,10:19:00,2.7700,2.7700,2.7700,2.7700,6000,0 SIF1,I,01/23/2008,10:20:00,2.7700,2.7700,2.7700,2.7700,7000,0 SIF1,I,01/23/2008,10:21:00,2.7800,2.7800,2.7700,2.7700,7100,0 SIF1,I,01/23/2008,10:23:00,2.7000,2.7000,2.7000,2.7000,6,0 SIF1,I,01/23/2008,10:25:00,2.7600,2.7600,2.7600,2.7600,600,0 SIF1,I,01/23/2008,10:27:00,2.7700,2.7700,2.7700,2.7700,8200,0 SIF1,I,01/23/2008,10:28:00,2.7800,2.7800,2.7700,2.7700,5400,0 SIF1,I,01/23/2008,10:29:00,2.7700,2.7700,2.7600,2.7600,500,0 SIF1,I,01/23/2008,10:31:00,2.7600,2.7600,2.7600,2.7600,1000,0 SIF1,I,01/23/2008,10:32:00,2.7200,2.7300,2.7200,2.7300,42,0 SIF1,I,01/23/2008,10:34:00,2.7700,2.7700,2.7700,2.7700,200,0 SIF1,I,01/23/2008,10:35:00,2.7700,2.7700,2.7700,2.7700,400,0 SIF1,I,01/23/2008,10:37:00,2.7700,2.7700,2.7700,2.7700,10000,0 those are just the first lines
  17. what can i do to improve this code? it takes 3 minutes to execute <?php echo date('l dS \of F Y h:i:s A'); $x= file ('C:\Documents and Settings\Administrator\Desktop\php\tickers.txt'); $fp=fopen('C:\Documents and Settings\Administrator\Desktop\php\test2.txt', 'w+'); $nrRanduri = count ($x); for ($i=0;$i<$nrRanduri;$i++) { $arr=explode(" ",$x[$i]); $Tran[$i]=$arr[0]; // modific sau tranzact //$tranzactieEfectuata=$arr[0]; $Piata[$i]=$arr[1]; // piata $Simbol[$i]=$arr[2]; // simbol //$simbol=$arr[2]; //$j[$i][3]=$arr[3]; // bid vol //$j[$i][4]=$arr[4]; // best bid //$j[$i][5]=$arr[5]; // best ask //$j[$i][6]=$arr[6]; // bid ask $VolTran[$i]=$arr[7]; // vol tranz $PretTran[$i]=$arr[8]; // pretul tranzact //$pretulTranzactiei=$arr[8]; //$j[$i][9]=$arr[9]; // nr tranzactii $DataSiOra[$i]=$arr[10]; // data s i ora //$j[$i][11]=$arr[11]; // variatia $ExplodeDataSiOra=explode(" ",$DataSiOra[$i]); $Data[$i]=$ExplodeDataSiOra[0]; $Ora[$i]=$ExplodeDataSiOra[1]; $ExplodeData=explode("-",$Data[$i]); $A[$i]=$ExplodeData[0]; $L[$i]=$ExplodeData[1]; $D[$i]=$ExplodeData[2]; $ExplodeOra=explode(":",$Ora[$i]); $Or[$i]=$ExplodeOra[0]; $Min[$i]=$ExplodeOra[1]; $Sec[$i]=$ExplodeOra[2]; } $simbolCautat[0]='SIF1'; $simbolCautat[1]='SIF2'; $simbolCautat[2]='SIF3'; $simbolCautat[3]='SIF4'; $simbolCautat[4]='SIF5'; $simbolCautat[5]='SNP'; $simbolCautat[6]='TLV'; $simbolCautat[7]='BRD'; $simbolCautat[8]='RRC'; $simbolCautat[9]='IMP'; $simbolCautat[10]='TEL'; $simbolCautat[11]='BIO'; $simbolCautat[12]='BRK'; $simbolCautat[13]='ATB'; $simbolCautat[14]='TBM'; $cifre=1000; for ($i=0;$i<255;$i++) { $timp[$i]=$cifre+$i; if (($i==59) || ($i==119) || ($i==179) || ($i==239)) $cifre=$cifre+40; } $nrRanduriSimbolCautat=count ($simbolCautat); $nrRanduritimp=count ($timp); for ($j=0;$j<$nrRanduriSimbolCautat;$j++) { for ($k=0;$k<$nrRanduritimp;$k++) { for($i=0;$i<$nrRanduri;$i++) { if ( ($Tran[$i]==1)&&($Simbol[$i]==$simbolCautat[$j])&&($timp[$k]=="$Or[$i]$Min[$i]") ) { $Pret[$j][$timp[$k]][]=$PretTran[$i]; $volMoment=$VolTran[$i]; $volMoment=str_replace(',', '', $volMoment); $Volum[$j][$timp[$k]][]=$volMoment; } } } } $io="<ticker>,<per>,<date>,<time>,<open>,<high>,<low>,<close>,<volume>,<openint>\n"; fwrite($fp,$io); for ($a=0;$a<$nrRanduriSimbolCautat;$a++) //pentru toate simbolurile fa continoarea { $h=415; //verifica cate elemente are fiecare sir a fiecarui simbol for ($b=1000;$b<1000+$h;$b++) { if (isset ($Pret[$a][$b])) { $f=count ($Pret[$a][$b]); $open=$Pret[$a][$b][0]; $close=$Pret[$a][$b][$f-1]; $maxim=max($Pret[$a][$b]); $minim=min($Pret[$a][$b]); $volumTotal=array_sum($Volum[$a][$b]); $k="$b"; $io="$simbolCautat[$a],I,01/23/2008,$k[0]$k[1]:$k[2]$k[3]:00,$open,$maxim,$minim,$close,$volumTotal,0\n"; fwrite($fp,$io); } } } echo date('l dS \of F Y h:i:s A'); ?>
  18. <?php $x[0]="2,700"; $x[0]= number_format($x[0], 2, '.', ''); $x[1]="1,700"; $x[1] =number_format($x[1], 2, '.', ''); $v=array_sum($x); $v= number_format($v, 2, '.', ''); echo $v; ?> and so is this: <?php $x[0]="2,700"; str_replace(',', '', $x[0]); $x[1]="1,700"; str_replace(',', '', $x[0]); $v=array_sum($x); $v= number_format($v, 2, '.', ''); echo $v; ?> this outputs me 3.00 in stead of 3.40 what i'm geting wrong?
  19. i hava a string var like this: $x="2,5000" i need to make that $x="25000" how can i do that?
  20. is there an easy way to find out max and min from the element of a array? and sum of the elements
  21. but if it is in a file?
  22. i have 2 data like this: 2008-01-23 11:48:42 2008-01-23 11:48:52 how can i compare witch one is first?
  23. i have a table that looks like this: where 135805 reprezent 13:58:05, i inserted like this, i whant to make a query that takes out first record form the interval 135800 135859 , the last, max and min, can you help me? 135805 0.2290 135806 0.2280 135826 0.2270 135855 0.2270 135918 0.2260 135954 0.2270 140055 0.2270 140103 0.2270 140226 0.2270 140323 0.2270 140331 0.2000 140651 0.2300 140717 0.2300 140755 0.2300 140821 0.2300 140840 0.2270 140841 0.2250 141245 0.2300
×
×
  • 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.