Re: [PHP-DB] Question in js about frameset rows
Hi, It's working Thanks Suad Bastien Koert wrote: I have fixed values that I adjust to, but you basically need to give the frame an ID and then use .rows and.columns to adjust the size function shrink() { top.document.getElementById(TOP).rows = 65,*,0,46,0; } function expand() { top.document.getElementById(TOP).rows = 65,*,200,46,0; } bastien From: suad [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] Question in js about frameset rows Date: Wed, 21 Jun 2006 11:44:07 +0200 Hi, I have this page: html head titletitle1/title /head frameset cols=*,200pxframeset id=frameset1 rows=10%,30%,10%,* frame src=/page1.phtml name=name1 frameborder=0 scrolling=no / frame src=/page2.phtml name=name2 frameborder=0 / frame src=/page3.phtml name=name3 frameborder=0 scrolling=no / frame src=/page4.phtml name=name4 frameborder=0 / /frameset frame src=/page5.phtml name=name5 frameborder=0 / /frameset /html And this is the content of the page page1.phtml: html head titlename1/title /head body span onclick=alert(window.parent.frames[1].name);change size of frame 2/span /body /html How can I change (using js) the rows of the frameset to: frameset rows=10%,10%,10%,* Thanks Suad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Question in js about frameset rows
Hi, I have this page: html head titletitle1/title /head frameset cols=*,200px frameset id=frameset1 rows=10%,30%,10%,* frame src=/page1.phtml name=name1 frameborder=0 scrolling=no / frame src=/page2.phtml name=name2 frameborder=0 / frame src=/page3.phtml name=name3 frameborder=0 scrolling=no / frame src=/page4.phtml name=name4 frameborder=0 / /frameset frame src=/page5.phtml name=name5 frameborder=0 / /frameset /html And this is the content of the page page1.phtml: html head titlename1/title /head body span onclick=alert(window.parent.frames[1].name);change size of frame 2/span /body /html How can I change (using js) the rows of the frameset to: frameset rows=10%,10%,10%,* Thanks Suad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] How can I get in PHP the number of files in a directory
Hi, This is for reading a file: ?php $handle = fopen(/home/rasmus/file.gif, r); ? How can I get in PHP the number of files in the directory (rasmus) and the files names in a loop? Thanks Suad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Displaying data in different languages
Hi You maybe can do that with the convert function see this link http://www.postgresql.org/docs/8.0/interactive/functions-string.html it is in postgresql, maybe this function will work in MYSQL Suad Manoj Singh wrote: Hi all, I am designing the web-site which is in different languages. I am using php and MYSQL database. Now the problem is the data is stored in the database in english language. How i change them to japanese? I want to display them in japanese. Please provide me some tips. Regards Manoj -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] help width sql
hi I have a problem whith inforcing the result of a selekect query, here is my tables and the query: I create this 4 tables: CREATE TABLE a ( a_id SERIAL PRIMARY KEY, a_name text ); CREATE TABLE b ( b_id SERIAL PRIMARY KEY, b_price INT2 ); CREATE TABLE c ( c_id SERIAL PRIMARY KEY, a_id INT4 REFERENCES a ON UPDATE CASCADE ON DELETE CASCADE, b_id INT4 REFERENCES b ON UPDATE CASCADE ON DELETE CASCADE, c_price INT2 ); CREATE TABLE d ( d_id SERIAL PRIMARY KEY, a_id INT4 REFERENCES a ON UPDATE CASCADE ON DELETE CASCADE, b_id INT4 REFERENCES b ON UPDATE CASCADE ON DELETE CASCADE, d_price INT2 ); Insert some values: INSERT INTO a (a_name) VALUES ('org1'); INSERT INTO a (a_name) VALUES ('org2'); INSERT INTO a (a_name) VALUES ('org3'); INSERT INTO b (b_price) VALUES (100); INSERT INTO b (b_price) VALUES (200); INSERT INTO b (b_price) VALUES (50); INSERT INTO c (a_id, b_id,c_price) VALUES (1,1,50); INSERT INTO c (a_id, b_id,c_price) VALUES (2,1,50); INSERT INTO c (a_id, b_id,c_price) VALUES (1,2,100); INSERT INTO c (a_id, b_id,c_price) VALUES (2,2,100); INSERT INTO c (a_id, b_id,c_price) VALUES (1,3,25); INSERT INTO c (a_id, b_id,c_price) VALUES (3,3,25); INSERT INTO d (a_id, b_id,d_price) VALUES (1,1,50); INSERT INTO d (a_id, b_id,d_price) VALUES (2,1,50); INSERT INTO d (a_id, b_id,d_price) VALUES (1,2,100); INSERT INTO d (a_id, b_id,d_price) VALUES (2,2,100); a_id | a_name --+ 1 | org1 2 | org2 3 | org3 b_id | b_price --+- 1 | 100 2 | 200 3 | 50 c_id | a_id | b_id | c_price --+--+--+- 1 |1 |1 | 50 2 |2 |1 | 50 3 |1 |2 | 100 4 |2 |2 | 100 5 |1 |3 | 25 6 |3 |3 | 25 d_id | a_id | b_id | d_price --+--+--+- 1 |1 |1 | 50 2 |2 |1 | 50 3 |1 |2 | 100 4 |2 |2 | 100 SELECT SUM(c_price) as sum,(SELECT SUM(d_price) FROM d WHERE a_id=t1.a_id ) AS payed FROM c AS t1 group by a_id order by payed; the result of this query is: sum | payed -+--- 150 | 150 175 | 150 25 | (3 rows) The question is : how can I force that the result of the col payed to be zerro 0 insted of notthig (NULL) and the order will be in way that the zerro's values comes first. and the result will be: sum | payed -+--- 25 | 0 150 | 150 175 | 150 Thanks Suad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] help in sql - postgresql
Hi, I need some help in sql - postgresql: I create this 4 tables: CREATE TABLE a ( a_id SERIAL PRIMARY KEY, a_name text ); CREATE TABLE b ( b_id SERIAL PRIMARY KEY, b_price INT2 ); CREATE TABLE c ( c_id SERIAL PRIMARY KEY, a_id INT4 REFERENCES a ON UPDATE CASCADE ON DELETE CASCADE, b_id INT4 REFERENCES b ON UPDATE CASCADE ON DELETE CASCADE, c_price INT2 ); CREATE TABLE d ( d_id SERIAL PRIMARY KEY, a_id INT4 REFERENCES a ON UPDATE CASCADE ON DELETE CASCADE, b_id INT4 REFERENCES b ON UPDATE CASCADE ON DELETE CASCADE, d_price INT2 ); Insert some values: INSERT INTO a (a_name) VALUES ('org1'); INSERT INTO a (a_name) VALUES ('org2'); INSERT INTO a (a_name) VALUES ('org3'); INSERT INTO b (b_price) VALUES (100); INSERT INTO b (b_price) VALUES (200); INSERT INTO b (b_price) VALUES (50); INSERT INTO c (a_id, b_id,c_price) VALUES (1,1,50); INSERT INTO c (a_id, b_id,c_price) VALUES (2,1,50); INSERT INTO c (a_id, b_id,c_price) VALUES (1,2,100); INSERT INTO c (a_id, b_id,c_price) VALUES (2,2,100); INSERT INTO c (a_id, b_id,c_price) VALUES (1,3,25); INSERT INTO c (a_id, b_id,c_price) VALUES (3,3,25); INSERT INTO d (a_id, b_id,d_price) VALUES (1,1,50); INSERT INTO d (a_id, b_id,d_price) VALUES (2,1,50); INSERT INTO d (a_id, b_id,d_price) VALUES (1,2,100); INSERT INTO d (a_id, b_id,d_price) VALUES (2,2,100); a_id | a_name --+ 1 | org1 2 | org2 3 | org3 b_id | b_price --+- 1 | 100 2 | 200 3 | 50 c_id | a_id | b_id | c_price --+--+--+- 1 |1 |1 | 50 2 |2 |1 | 50 3 |1 |2 | 100 4 |2 |2 | 100 5 |1 |3 | 25 6 |3 |3 | 25 d_id | a_id | b_id | d_price --+--+--+- 1 |1 |1 | 50 2 |2 |1 | 50 3 |1 |2 | 100 4 |2 |2 | 100 SELECT SUM(c_price) as sum,(SELECT SUM(d_price) FROM d WHERE a_id=t1.a_id ) AS payed, SUM(c_price)-(SELECT SUM(d_price) FROM d WHERE a_id=t1.a_id ) AS to_pay FROM c AS t1 group by a_id order by payed; the result of this query is: sum | payed | to_pay -+---+ 150 | 150 | 0 175 | 150 | 25 25 | | *The question is* : how can I force that the result of the col payed to be zerro 0 insted of nothing (NULL) and the order will be in way that the zerro's values comes first. and the result will be: sum | payed | to_pay -+---+ 25 | 0 | 0 150 | 150 | 0 175 | 150 | 25 Thanks Suad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] help in sql - postgresql
Hi, Thanks a lot, That exactly wat I need :) Suad Chris wrote: suad wrote: Hi, I need some help in sql - postgresql: snip Yay a postgres question! :D hee hee *The question is* : how can I force that the result of the col payed to be zerro 0 insted of nothing (NULL) and the order will be in way that the zerro's values comes first. and the result will be: sum | payed | to_pay -+---+ 25 | 0 | 0 150 | 150 | 0 175 | 150 | 25 COALESCE will do it for you: SELECT SUM(c_price) as sum,(SELECT COALESCE(SUM(d_price), 0) FROM d WHERE a_id=t1.a_id ) AS payed, SUM(c_price)-(SELECT COALESCE(SUM(d_price), 0) FROM d WHERE a_id=t1.a_id ) AS to_pay FROM c AS t1 group by a_id order by payed; sum | payed | to_pay -+---+ 25 | 0 | 25 150 | 150 | 0 175 | 150 | 25 (3 rows) http://www.postgresql.org/docs/8.1/interactive/functions-conditional.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php