[PHP-DB] auto_increment
How do I change the auto_increment / auto_index value? Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] auto_increment
Ron Piggott (PHP) wrote: How do I change the auto_increment / auto_index value? Ron Do a query that does what you want. Without knowing the type of DB you're using (and since this is a "PHP and Database" list not just specific DB list) or any other info, there really isn't much you can get from here. You should likely ask on a list specific to your question. This will help in your search for info: http://www.catb.org/~esr/faqs/smart-questions.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] auto_increment
I am using mySQL On Mon, 2006-05-01 at 13:21 +, replies-lists- [EMAIL PROTECTED] wrote: > > Original Message > > Date: Monday, May 01, 2006 09:14:36 AM -0400 > > From: "Ron Piggott (PHP)" <[EMAIL PROTECTED]> > > Subject: [PHP-DB] auto_increment > > > > How do I change the auto_increment / auto_index value? Ron > > -- End Original Message -- > > that depends on the database you're using -- and probably best asked on > the appropriate db-specific mailing list. > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] auto_increment
On 5/1/06, Ron Piggott (PHP) <[EMAIL PROTECTED]> wrote: I am using mySQL .. a google search for "mysql reset auto_increment" reveals the answer! -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] auto_increment
Ron Piggott (PHP) wrote: I am using mySQL In that case, mysql.com woudl have MySQL specific resources since it has nothgin to do with PHP (aside form that is apparently what you're using to interact with MySQL) Please read http://www.catb.org/~esr/faqs/smart-questions.html#forum the entire URL is excellent but that specifric section will apply to this thread. Also *please* do not top post :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] capture a webpage to later process it
Maybe you are looking is CURL function. On 4/29/06, John Hicks <[EMAIL PROTECTED]> wrote: John Hicks wrote: > J. Alejandro Ceballos Z. -JOAL- wrote: >> >> I want to read the results of an URL address, to later process it and >> insert part of them as internal code. >> >> If I use include or require, they inserts ALL the resulting code, but >> I want to do something like: >> >> >> blah, blah, blah >> > $result_webpage = somephpfunc('http://other.sit/externalpage.html'); >> if >> (eregi("result:([:alnum:]+).*([:alnum:]+\.jpg)",$result_webpage,$array_match)) >> >>{ echo "External status:".$array_match[1]."image: > src=\""..$array_match[2]."\">"; } >> ?> >> blah, blah, blah > > If you have fopen wrappers enabled (see > http://us2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen) > then you can simply use file_get_contents() to read the web page into a > string. You can then manipulate it with regexes like so: > > $Url = 'http://www.php.net'; > $ThePageContents = file_get_contents($Url); > $TheNewPageContents = preg_replace('/PHP/', 'Ruby :)', $ThePageContents); > echo $TheNewPageContents; > > --J > Here's a more useful use of the same idea: ]*>)/', "\1", $ThePageContents); echo $TheNewPageContents; } else { echo "Enter a URL as a query string in this URL, e.g.: http://www.yahoo.com\"; > http://${_SERVER['SERVER_NAME']}${_SERVER['PHP_SELF']}?Url= http://www.yahoo.com"; } ?> This allows you to run your own rather sloppy proxy. Just plug the url you want into the query string for your page (or, better still, make a form to post it): https://mydomain.com/mypage.php?Url=http://DomainIWantToView.com/PageIWantToView.html The regex adds a tag to the remote web page to make the images and links work. But of course, that means the gets of all the images, css, js, etc. will all show up with your workstation IP on the remote server's log (and on your boss's log of your browsing), so you haven't really accomplished much :( But it's kind of fun, huh? -- 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