Back to the month index |
Back to the list index
|
Rajat Tiwary (rajat_tiwary@yahoo.com)
Thu, 9 Mar 2000 20:16:13 -0800 (PST)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: TADNet Catch All Address: "RE: RE : Perl DBI book"
- Previous message: Fernando Lozano: "Re: Where's Bambi"
- In reply to: Juan Ildefonso Núñez Pérez: "Where's Bambi"
- Next in thread: Rajat Tiwary: "Re: Re: mSQL Re-awaking"
Message-ID: <20000310041613.27402.rocketmail@web221.mail.yahoo.com> Date: Thu, 9 Mar 2000 20:16:13 -0800 (PST) From: Rajat Tiwary <rajat_tiwary@yahoo.com> Subject: Re: Re: mSQL Re-awakingHi Juan,
Yeah .... if ur using postgres and have already
installed it .. u get loads of ps.gz docs to use it
...
similarly if u have already installed php3 ( mod_php3
for apache )
then u get the complete manual with it .. otherwise u
can go to www.php.net and download the manual ...
In the manual u get the complete list of functions for
each database connectivity thru php3 ... like msql,
mysql, postgres, oracle .. etc.
plus the thumb rule is very simple,
a) open the socket ( $sock )
b) use $sock to send the query using any of the
standard functions of php3 of the database being used
c) use the result variable $res in conjunction with ur
standard php3 functions and control stuctures + html
to generate the required formated result on ur web
page.
an example script is below ---
"); $name = pg_dbname($sock); echo("Database = $name
"); $options = pg_options($sock); echo("Options = $options
"); $port = pg_port($sock); echo("Port = $port
"); $tty = pg_tty($sock); echo("TTY = $tty
"); $host = pg_host($sock); echo("Host = $host
"); $res = pg_exec( $sock, "SELECT * from table"); echo("Result number = $res
"); $err_msg = pg_errormessage($sock); echo("$err_msg"); $col = pg_numfields($res); echo("Number of Columns = $col
"); $row = pg_numrows($res); echo("Number of Rows = $row
"); $field = pg_fieldname($res,0); echo("Name of the Column = $field
"); $count = 0; while ( $count < $row ) { $buff = pg_result($res,$count,$field); echo("Value = $buff
"); $count = $count + 1; } ?>But hey this is not the postgres mailing list ..
:)
the above script will work for msql too ... just
replace the postgres specific functions to msql
specific functions of php3 ...
but one thing has to be kept in mind ... mod_php3
works with one database at a time .. that means it has
to be re-compiled with the database switch with which
it has to be used ...
i hope it is helpfull to u ...
:)
Rajat
--- "Ing. Juan Carlos Fernandez-B"
<juan@linux.form-net.com> wrote:
> is there a good postgress php3 tutorial out there
> that you can recomend?
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
-------------------------------------------------------------------------
To unsubscribe, go to http://www.Hughes.com.au/extras/email/
- Next message: TADNet Catch All Address: "RE: RE : Perl DBI book"
- Previous message: Fernando Lozano: "Re: Where's Bambi"
- In reply to: Juan Ildefonso Núñez Pérez: "Where's Bambi"
- Next in thread: Rajat Tiwary: "Re: Re: mSQL Re-awaking"