RE: [PHP-DB] column names

2001-04-03 Thread Brian Hardwick

"SHOW FIELDS FROM $table"

- Brian 
Tangible Networks
www.tangible-networks.com

-Original Message-
From: Mauricio Junqueira [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 5:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] column names



HI,

does anyone knows how to retrive information about the columns names of a 
table?
I know that is possible to use show table mytable using isql but
I need to get information about the columns using sql.
that information is to be accessed with a php script. so, I'm looking
for something resembling "select info from table" 

How may I supposed to do that?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] How to limit a WHILE statement?

2001-04-02 Thread Brian Hardwick

Your might want to consider limiting the records selected.  For example
"select emp_name from employees limit 0,20".

Alternatively consider using a a "for" statement.

- Brian Hardwick
Tangible Networks.

-Original Message-
From: Bob Stone [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 02, 2001 6:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] How to limit a WHILE statement?


Dear PHP Helpers,

What is your recommendation on limiting a while
statement so that it only iterates a maximum of 20
times?

Here is the code snippet:

$result = mysql_query($sql, $db);

while ($myrow = mysql_fetch_array($result)) {

printf("Name: bfont color=\"green\" size=\"5s\"%s
%s %s %s\nbr/b/font", $myrow["salutation"],
$myrow["first_name"], $myrow["mid_name"],
$myrow["user_name"]);

Best regards,

Bob Stone

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Problems with Oracle connections

2001-03-29 Thread Brian Hardwick

I belive you have to set your sid and oracle_home before attempting to
ora_logon?

putenv("ORACLE_SID=your sid);
putenv("ORACLE_HOME=your oracle home);

if(ora_plogon("rascunho@dvfpmm","java"))
{ echo "conectou"; }
else
{ echo "falhou outra vez:".ora_error(); }")

-Original Message-
From: bgadelha [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 8:37 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Problems with Oracle connections


Hi,
I'm having troubles using PHP+Oracle.
Im under Win98, with Apache WebServer, PHP4 and Oracle.
When I try to connect, the following error message is
displayed:

Warning: Unable to connect to ORACLE (ORA-12154:
TNS:could not resolve service name) in
c:\apache\htdocs\testeoracle.php on line 24
falhou outra vez:ORA-12154: TNS:could not resolve
service name

Here is my code:

?php

if(ora_plogon("rascunho@dvfpmm","java"))
{ echo "conectou"; }
else
{ echo "falhou outra vez:".ora_error(); }

phpinfo(INFO_ENVIRONMENT);

?

Can somebody help me?

Thanks
Bruno.


__
O BOL  Top3 no iBest! Vote j para torn-lo Top1!
http://www.bol.com.br/ibest.html



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Copy data from one mysql table to another?

2001-03-28 Thread Brian Hardwick

do something like -

1. make a third table indentical to table svt_members. lets call it
svt_members_temp.

2. load the svt_members_temp table with the merged values.

"Insert into svt_members_temp(key_svt_members, phone, etc,etc,etc)
Select phone.key_svt_members, phone.phone, svt_members.etc, svt_members.etc,
svt_members.etc
From svt_members, phone
Where svt_members.key_svt_members = phone.key_svt_members"

3. cross your fingers (or backup)

4. empty the contents of the original table.
"delete from svt_members"

5. load the data back into the real table.

"Insert into svt_members(key_svt_members, phone, etc,etc,etc)
Select svt_members_temp(key_svt_members, phone, etc,etc,etc)"

- brian hardwick

-Original Message-
From: Bob Stone [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 3:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Copy data from one mysql table to another?


Dear PHP Helpers,

I cannot find any documentation on how to copy the
data from one mysql table to another, i.e. table1,
columnx to table2, columnx.

Can you recommend a way?

Here is the situation.

I have one table called "phone" with two columns. The
first column is called "key_svt_members," the second
is called "phone."

I have a second table called "svt_members." This table
has 17 columns including "key_svt_members" and
"phone." The phone column in this table is currently
empty.

I wish to copy the data that is in phone, phone into
svt_members.

Can you recommend a method?

Thanks in advance,

Bob Stone

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Getting info from remote host

2001-03-26 Thread Brian Hardwick

I have done this by making a fsockopen call to the remote host (port 80),
request the page to be loaded using a http "get", read the returned page
into a buffer and parse through it for the information requested.

- Brian Hardwick
Tangible Networks


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 2:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Getting info from remote host


An outside host cgi script outputs some information, in this case - stock
price.

They output in plain ascii, stock price and last update on two separate
lines.

Would PHP be able to request the info from the CGI [it's a URL] and output
it onto a page?

I asked this here just in case there was some database temporary storage
ideas out there too.

My idea was to make the http request and load it into an array, to be
output in a PHP page.


Thanks,
Ryan


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]