Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by xfire123

  1. Can i pass this two variables to the php script and start him without need to redirect me to page? I need just to generate the json
  2. Hello! I have a problem. Can you help me please. A user is entering two dates in to a form. When he press submit the date pass in another opened page and doing stuff. Can i pass this variables to one more php file. He create a json file. I need to create this json right after user hit submit and then redirect to the page. Im using this to redirect and pass the two dates header("location:gentable_chart.php?" . $_SERVER['QUERY_STRING']); exit(); I need to pass the variables one more time to create the json before the redirect. Any idea how to do this?
  3. Hello! Can you tell me how to create chart(like Excel chart) from for example PostgreSQL tables in Website. I`m searching in google but im not finding any freeware method... Can you help me?
  4. Great, thank you. And still can i echo cavch number from corresponding to the MAX amount in your example?
  5. Nice example thanks. I deal with similar DB structure in another topic in the forum. But in this two cases i'm not the designer of this DBs. But i got the idea. Someone told me to create a view that returns a normalized result. At this time i don't have any experience for that. In my example i get the last records of all columns for the 'max'. I don't see what query will do that for this example. And how to display the name(number) of column fom the max cavch in your example?
  6. Hello!!! Any idea how to accomplish this: I want to echo the column name and the value of max($obj->CAVCH1,$obj->CAVCH2,$obj->CAVCH3) Here is the other part of the code $serverName = "IP"; //serverName\instanceName $connectionInfo = array( "Database"=>"DBname", "UID"=>"username", "PWD"=>"password"); $conn = sqlsrv_connect( $serverName, $connectionInfo); $result = sqlsrv_query($conn,"SELECT TOP (1) Events.EventDate, AVDCAV.CAVCH1, AVDCAV.CAVCH2, AVDCAV.CAVCH3 FROM AVDCAV INNER JOIN Events ON AVDCAV.IDEvent=Events.EventID WHERE CAVCH1 > 0 or CAVCH2 > 0 or CAVCH3 > 0 ORDER BY AVDCAV.IDEvent DESC"); $obj = sqlsrv_fetch_object( $result ); $maxObj = max($obj->CAVCH1,$obj->CAVCH2,$obj->CAVCH3); Now i can only to echo the biggest value from the this 3 columns. The numbers are like 0.123 etc.
  7. Is there any way to link one "if" statement if is true or false. And then use this condition to another "if"? Like this: ifn(...){...} = true $if1= if1(...){...} ... $if(n)=ifn(...){...} then if ($if1 || $if(n)) { do something} I hope you understand ok btw i write "I hope you understand" when you write it the Matrix is strong
  8. Can you give me an example what will be the the code after normalization of the DB. What will be the for loop after this? This is part of the table with some values. Lets say this is the complete table. How to normalize and make a php loop like my example in the beginning in more simple way like you said?
  9. Im reading tutorials atm. Thanks. I will ask again when i'm ready.
  10. Btw i auto import the data in table from csv files in particular time. Just mention.
  11. Now can you give me more detail explanation via code example. I don't understand very clear. Maybe you will post a link to tutorial or something?
  12. Yes its not my primary language. Ok. Here is the table: -- Table: public.otv_fil -- DROP TABLE public.otv_fil; CREATE TABLE public.otv_fil ( "timestamp" timestamp without time zone, blok9osx double precision, timestamp2 timestamp without time zone, con integer, blok9osy double precision, timestamp3 timestamp without time zone, con2 integer, blok11osx double precision, timestamp4 timestamp without time zone, con3 integer, blok11osy double precision, timestamp5 timestamp without time zone, con4 integer, filblok10 double precision, timestamp6 timestamp without time zone, con5 integer, filblok11 double precision, timestamp7 timestamp without time zone, con6 integer ) WITH ( OIDS = FALSE ) TABLESPACE pg_default; ALTER TABLE public.otv_fil OWNER to postgres; Is this the structure that i must to show?
  13. Yes in here for($ri = 0; $ri < $numrows; $ri++) { $row2 = pg_fetch_array($result, $ri); if ($row["blok9osx"] > 1.2){ $warning = "<span class='warning'>{$row['blok9osx']} l/s</span>"; } else { $warning = "<span class='normal'>{$row['blok9osx']} l/s</span>"; } echo $warning; } Sorry for my English.
  14. I meant the last record in the table.
  15. The code is mine. There is not need to test me. I'm in hurry to copy and paste. This is another "if" from other 4 like him. What is the problem... this is simple example what is the structure. $result = pg_exec($link, "select timestamp,blok11 from otv_fil WHERE blok11 NOT BETWEEN -4 AND 10 ORDER BY timestamp desc limit 1;");
  16. $result = pg_exec($link, "select timestamp,blok9osx from otv_fil WHERE blok9osx NOT BETWEEN -4 AND 10 ORDER BY timestamp desc limit 1;"); One column with type - "temestamp" and five with type - "double precision"
  17. 1) yes i have mistake there. The $row variable was in another please... 2) I have separate columns 3) This is code for example, there is some more data in the "if"s I will try to explain more: I have a table with multiple columns. I get every last row of every column. I compare if any data is out of range by using "if" statements. The "for" loop in this case i think is not necessary because i use only one row. This is due to the lack of sufficient knowledge by me . I use this information to display 5 measures in the page. Now i want to group them in to one and display an element that will represent text alarm when one of this elements have boolean type of true
  18. for($ri = 0; $ri < $numrows; $ri++) { $row2 = pg_fetch_array($result, $ri); if ($row["blok11"] > 1.2){ $warning = "<span class='warning'>{$row['blok11']} l/s</span>"; } else { $warning = "<span class='normal'>{$row['blok11']} l/s</span>"; } echo $warning; } If i have couple of this, i need: if ("for" || "for") == true do something...
  19. Hello. Sorry if my question is not very clear. I have multiple "for" functions. Inside them there are "if"s(maximum 1 if/else in each "for" function). I want to create function that echo something if one of this "if"s are true. Can you give me an example? Thanks!
  20. I used "n" instead of "m" in date. But the sorting in js its not working.
  21. Hello again. I'm wondering now how to fix this sort from: 10 01 02 03 04 05 06 07 08 09 to: 1 2 3 4 5 6 7 8 9 10 The main problem i think is the "0" infront
  22. its say: PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\WEB\\PHP\\ext\\php_intl.dll' - The specified module could not be found.\r\n in Unknown on line 0 I fixed it when i copy all icu*.dll files in Apache bin directory... at last I tested it and works like a charm. Thank you very much.
  23. It giving me: Fatal error: Uncaught Error: Class 'IntlDateFormatter' not found in C:\WEB\Apache24\htdocs\inc_req\menu_HQ.php:2 Stack trace: #0 C:\WEB\Apache24\htdocs\HQ.php(20): require() #1 {main} thrown in C:\WEB\Apache24\htdocs\inc_req\menu_HQ.php on line 2 I comment out extension=php_intl.dll restarted service. Still same error.
  • 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.