make form list with option select

make form list with option select

am 26.03.2003 06:05:56 von Ahmad Sentri

hi ..
this my problem with php-postgresql


this syntax php with postgresql ....
this syntax still wrong / error
in my form doesn't list ...


Kode Fakultas




table in postgresql


CREATE TABLE FAKULTAS (KODE_FAK CHAR (1)NOT NULL,
NAMA_FAK VARCHAR (50),
NAMA_FAK_EN VARCHAR (50),
CONSTRAINT XPKFAKULTAS
PRIMARY KEY (KODE_FAK));
help me please ...
thank's
newbie php-postgresql


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: make form list with option select

am 26.03.2003 07:53:55 von apz

Ahmad Sentri wrote:
> this syntax php with postgresql ....
> this syntax still wrong / error
> in my form doesn't list ...

I am assuming that $conn is created somewhere above ok

> > $query1="select kode_fak, nama_fak from fakultas";
> $query_result1 = pg_query($conn, $query1);
> while ($row1 = pg_fetch_array($query_result1))
> {
> echo "\n";
> }
>
> ?>

first thing I would think of is how you access $row1

1. prolly you meant $row1["kode_fak"]
you should quote your keyname, otherwise php thinks its something
special, not a variable, not a string

2. I think its more obvious for compiler if you do it more explicitly:

echo "\n";

it should say:

echo "\n";


if you dont see it, I had ".>" while should be "'>" (to close the html
value string for the option tag). blah, hope this does not deter from
getting this thing for you to work.


enjoy



/apz, Learn to pause -- or nothing worthwhile can catch up to you.


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Re: make form list with option select

am 26.03.2003 17:11:43 von Ray Hunter

--=-2RIbaA9B1fjlgwTbgm7E
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Or you could just do this to:

echo=20
"\n";

That will work too...

--
Ray


On Tue, 2003-03-25 at 23:59, apz wrote:
> apz screwed up:
> > echo "\n";
>=20
> it should say:
>=20
> echo "\n";
>=20
>=20
> if you dont see it, I had ".>" while should be "'>" (to close the html=
=20
> value string for the option tag). blah, hope this does not deter from=20
> getting this thing for you to work.
>=20
>=20
> enjoy
>=20
>=20
>=20
> /apz, Learn to pause -- or nothing worthwhile can catch up to you.
>=20
>=20
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

--=-2RIbaA9B1fjlgwTbgm7E
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+gdE/azmPVcw0EKwRAmIEAKCIIENoxUu5NT3H1ySqN7jhLFAbcQCf dkKd
aUYQaGnRswKnr+Zgd8F8oKI=
=b7ns
-----END PGP SIGNATURE-----

--=-2RIbaA9B1fjlgwTbgm7E--