[PHP-DB] intercative selection menu

2002-06-21 Thread Dib, Walid (MED, Stagiaire GEMS)

Hello, I need to  get back the present value in the data base and to
post(show) it in the menu of selection.  somebody has an idea??

Thank you in advance.   
:
  
   1904
   1905
   1906
   1907
   1908
   1909
   1910
   1911
   1916
   volta
   scatt11
  


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] ARRAY, IF & INSERT

2002-06-21 Thread César Aracena

Hi all.
 
I have this form in which one Administrator can insert new members and
after that, in another page, a form where he/she can insert the new
member’s sons & daughters. I want to display a table with “text inserts”
into the admin can type let’s say a maximum of 5 kids in the second
page. The “members” table will have one memberID field (which will be
shared between parents and kids) and a levelID which will grant 0 for
the parent and 1, 2, 3, 4, 5 for the kids.
 
Now, how do I tell PHP to make an array from the kids input, but only
from the fields in which let’s say the “name” field was filled out in
order to spend the necessary table’s rows. Another thing… the Array
should also specify new levelID’s for each kid from 1 to 5. It would be
great if you also show me how to deal with it after it’s created.
 
Thanks a lot and sorry for so many questions,
 
Cesar Aracena  
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621
 



[PHP-DB] Re: ARRAY, IF & INSERT

2002-06-21 Thread Jesper Brunholm

(i am new to these groups, but shouldn't there be a follow-up-to on a 
X-post?)

César aracena wrote:
> I have this form in which one Administrator can insert new members and
> after that, in another page, a form where he/she can insert the new
> member’s sons & daughters. I want to display a table with “text inserts”
> into the admin can type let’s say a maximum of 5 kids in the second
> page. 

The number doesn't matter if you design you db well (I suppose we are 
talking database).

I suppose that you have a table with members with unique ID's?

Make a new table with relatives, where you connect to their parents 
through a ParentID-field

This way you'll avoid empty fields for the folks with eg. only 2 sons :-)

The query for father + sons and daughters would then be like

mysql_query("
select members.Name, members.ID, relatives.Name as RelativeName, 
relatives.ID
from parents, relatives
where parents.ID = relatives.ParentID
")

The “members” table will have one memberID field (which will be
> shared between parents and kids) and a levelID which will grant 0 for
> the parent and 1, 2, 3, 4, 5 for the kids.

You _can_ put them all in the same table, but I suppose that you have a 
lot of data stored on the parents/members, that is non-existing and 
irellevant for the children - this will give a lot of empty fields, 
which is why i propose the solution above...

> Now, how do I tell PHP to make an array from the kids input, but only
> from the fields in which let’s say the “name” field was filled out in
> order to spend the necessary table’s rows. Another thing… the Array
> should also specify new levelID’s for each kid from 1 to 5. It would be
> great if you also show me how to deal with it after it’s created.

It's easy to select only rows with contents for at certain field:

select * from relatives
where Name <> 0

I hope this was of some help?

regards

Jesper Brunholm

-- 
Phønix - Danish folkmusic from young musicians - http://www.phonixfolk.dk


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] FW:

2002-06-21 Thread Jose Moreira

- Nco quebre a brincadeira. 
> > >>> > > 
> > >>> > > Se seu nome estiver na lista, coloque um asterisco ao 
> > >>> > > lado. 
> > >>> > > Se NAO, adicione seu nome em ordem alfabitica. 
> > >>> > > Mande para 10 pessoas e tambim para pessoa que lhe 
> > >>> > > enviou. 
> > >>> > > Vai ver o que acontece... i super legal! 
> > >>> > > 
> > >>> > > Abigail* 
> > >>> > > Adriana* 
> > >>> > > Albert 
> > >>> > > Aaron* 
> > >>> > > Adam 
> > >>> > > Adelaide 
> > >>> > > Ademir 
> > >>> > > Alaide 
> > >>> > > Alam 
> > >>> > > Alessandra** 
> > >>> > > Alfredo 
> > >>> > > Alice* 
> > >>> > > Alex 
> > >>> > > Alix 
> > >>> > > Allison 
> > >>> > > Alyce 
> > >>> > > Allyson 
> > >>> > > Alvaro 
> > >>> > > Amanda*** 
> > >>> > > Amber 
> > >>> > > Amelia 
> > >>> >  Amy 
> > >>> >  > Ana Bela 
> > >>> > > Ana Carolina* 
> > >>> > > Ana Claudia 
> > >>> > > Ana Cristina** 
> > >>> > > Ana Helena 
> > >>> > > Ana Isabel 
> > >>> > > Ana Lucia** 
> > >>> >  Ana Maria** * 
> > >>> >  Ana Margarida 
> > >>> > > Ana Paula** * 
  Ana Rita
> > >>> > > Ana Silvia 
> > >>> > > Anaurelin 
> > >>> > > Anderson** 
> > >>> > > Andre 
> > >>> > > Andrea* 
> > >>> > > Andreia** 
> > >>> > > Andreza 
> > >>> > > Anelisa 
> > >>> > > Anezinho 
> > >>> > > Angela 
> > >>> > > Angelica 
> > >>> > > Anna*** 
> > >>> > > Annie** 
> > >>> > > Annike 
> > >>> > > Antoine 
  Antonieta 
> > >>> > > Antonio* 
> > >>> > > April 
> > >>> > > Aristoteles 
> > >>> > > Arthur 
> > >>> > > Ash** 
> > >>> > > Ashlee* 
> > >>> > > Ashley*** 
> > >>> > > Audrey 
> > >>> > > Austin 
> > >>> > > Barbara * 
> > >>> > > Basemate 
> > >>> > > Beatriz*** 
> > >>> > > Betania 
> > >>> > > Beth*** 
> > >>> > > Beti 
> > >>> > > Bianca 
> > >>> > > Bill 
> > >>> > > Bob 
> > >>> > > Bobbie 
> > >>> > > Bobby 
> > >>> > > Bonnie 
> > >>> > > Brad** 
> > >>> > > Branco 
> > >>> > > Breiann 
> > >>> > > Brian ** 
> > >>> > > Bridget* 
> > >>> > > Brittany* 
> > >>> > > Britney 
> > >>> > > Brooke 
> > >>> > > Bruno** 
> > >>> > > Blake 
> > >>> > > Carina 
> > >>> > > Camila 
> > >>> > > Carla * 
> > >>> > > Carlos * *** 
> > >>> > > Carmem 
> > >>> > > Carmen 
> > >>> > > Carolina* 
> > >>> > > Caroline* 
> > >>> > > Casey 
> > >>> > > Cassandra* 
> > >>> > > Cassia** 
> > >>> > > Cassiana 
> > >>> > > Cassidy 
> > >>> > > Caitli 
> > >>> > > Celeste 
> > >>> > > Cesar 
> > >>> > > Chastity 
> > >>> > > Chelsea 
> > >>> > > Chris 
> > >>> > > Christopher* 
> > >>> > > Christian 
> > >>> > > Christina ** 
> > >>> > > Christiane* 
> > >>> > > Chrystiano 
> > >>> > > Cristina  
> > >>> > > Chuck * 
> > >>> > > Cibele 
> > >>> > > Cida * 
> > >>> > > Cidinha 
> > >>> > > Cindy 
> > >>> > > Cintia 
> > >>> > > Cidilene* 
> > >>> > > Claire* 
> > >>> > > Claude 
> > >>> > > Claudenice 
> > >>> > > Claudia 
> > >>> > > Claudio 
> > >>> > > Cleusa 
> > >>> > > Cliceu 
> > >>> > > Conceigco  * 
> > >>> > > Connie 
> > >>> > > Courtney 
> > >>> > > Cristiane* 
> > >>> > > Cristhiane 
> > >>> > > Daniel* 
> > >>> > > Daniela* 
> > >>> > > Daniele 
> > >>> > > Danieli 
> > >>> > > Davi 
> > >>> > > Davine 
> > >>> > > Debora 
> > >>> > > Deborah 
> > >>> > > Debra 
> > >>> > > Deise 
> > >>> > > Deizi 
> > >>> > > Delila 
> > >>> > > Dennean 
> > >>> > > Denise 
> > >>> > > Deolinda 
> > >>> > > Diana* 
> > >>> > > Diane 
> > >>> > > Dilbert 
> > >>> > > Diogo** 
> > >>> > > Dolores * 
> > >>> > > Douglas 
> > >>> > > Dudley 
> > >>> > > Dulce 
> > >>> > > Edilson 
> > >>> > > Edmundo 
> > >>> > > Edna* 
> > >>> > > Edrio 
> > >>> > > Edson* 
> > >>> > > Eduardo 
> > >>> > > Eduy 
> > >>> > > Edward 
> > >>> > > 
> > >>> > > Euginia *** 
> > >>> > > Elaine** 
> > >>> > > Elen 
> > >>> > > Eleonora 
> > >>> > > Eliana 
> > >>> > > Eliane* 
> > >>> > > Elisamara 
> > >>> > > Elisangela 
> > >>> > > Elisete 
> > >>> > > Elizabeth** 
> > >>> > > Ella 
> > >>> > > Ellen 
> > >>> > > Eloisa* 
> > >>> > > Elsie 
> > >>> > > Elza 
> > >>> > > Emerson 
> > >>> > > Emilio 
> > >>> > > Emily 
> > >>> > > Enilva * 
> > >>> > > Eriton 
> > >>> > > Ernani 
> > >>> > > Estela 
> > >>> > > Evaldo 
> > >>> > > Eva 
> > >>> > > Evanei 
> > >>> > > Fab

[PHP-DB] WebSite Submissions Question

2002-06-21 Thread Daz

Hi All

On the website I am building, my Index page (index.html) does a check 
to see if it is Internet Explorer or Netscape Navigator that the user 
has for a browser.. and redirects the user to either

header("Location: ../nav/index.html");

or

header("Location: ../ie/index.html");

depending on the result...

I have one worry though, and that is how do search engines react to 
this, when ranking the site? I have all the meta data optimization 
etc after the redirection but do the search engines see this or 
follow the link?? Do they ignore the  structure??

I already parse all .html through PHP with Apache, hence the .php is 
not required or penalized...

Thanks for any advice...

Daz


-- 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] a "back" include script

2002-06-21 Thread Duncan Hill

On Fri, 21 Jun 2002, Dib, Walid (MED, Stagiaire GEMS) wrote:

> I want to create a file include .inc which by calling it in almost all the
> pages which I use, will return me to the previous page, thus this script

To manipulate the browser in such a way, you have at least two options:
1) Make the .inc just have a link to the REFERER value from the browser.
2) Make the .inc generate javascript containing a history manipulator


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] WebSite Submissions Question

2002-06-21 Thread Martin Clifford

Since PHP is parsed before ever reaching it's destination for viewing/profiling, there 
should be no penalties for putting this on your page.  If you have a page like the 
following (in PHP):




Then it will come up like so, when Google/Yahoo/Whoever goes to view it for inspection:


blahblah.

HTH

Martin

>>> Daz <[EMAIL PROTECTED]> 06/21/02 07:33AM >>>
Hi All

On the website I am building, my Index page (index.html) does a check 
to see if it is Internet Explorer or Netscape Navigator that the user 
has for a browser.. and redirects the user to either

header("Location: ../nav/index.html");

or

header("Location: ../ie/index.html");

depending on the result...

I have one worry though, and that is how do search engines react to 
this, when ranking the site? I have all the meta data optimization 
etc after the redirection but do the search engines see this or 
follow the link?? Do they ignore the  structure??

I already parse all .html through PHP with Apache, hence the .php is 
not required or penalized...

Thanks for any advice...

Daz


-- 

-- 
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




RE: [PHP-DB] Innodb and transactions.

2002-06-21 Thread Steve Bradwell

So should I be using Innodb tables or BDB tables?

Thanks,
Steve.

-Original Message-
From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 21, 2002 2:49 AM
To: Php-Db (E-mail)
Subject: Re: [PHP-DB] Innodb and transactions.


Hi,

you have to do something like this:

mysql_query('SET AUTOCOMMIT=0');

mysql_query('COMMIT'); or mysql_query('ROLLBACK');
mysql_query('SET AUTOCOMMIT=1');

bye,

Steve Bradwell schrieb:
> Hi all,
> 
> I have just figured out and set up my Innodb on my mysql server so I can
use
> transactions Begin, commit, rollback. I'm now looking for examples on how
to
> do this with php. I hit the php site and the best I could find was
> fbsql_commit etc... is this what I'm looking for? There's no documentation
> yet. I'm using php4 with mysql 3.23.49-max, and my tables are Innodb.
> 
> I appologize if my lingo is somewhat confusing or just wrong but I'm
pretty
> new to this stuff.
> 
> Any input or examples would be greatly appreciated.
> 
> Thanks,
> Steve.
> 
> 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
"...the number of UNIX installations has grown to 10, with more expected..."
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
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




Re[2]: [PHP-DB] a "back" include script

2002-06-21 Thread Latex Master

Hello Duncan,

Friday, June 21, 2002, 3:50:10 PM, you wrote:

DH> On Fri, 21 Jun 2002, Dib, Walid (MED, Stagiaire GEMS) wrote:

>> I want to create a file include .inc which by calling it in almost all the
>> pages which I use, will return me to the previous page, thus this script

DH> To manipulate the browser in such a way, you have at least two options:
DH> 1) Make the .inc just have a link to the REFERER value from the browser.
DH> 2) Make the .inc generate javascript containing a history manipulator

The first one want work if the person is behing a socks server or PHP
gets a referer diferently?



-- 
Best regards,
 Latexmailto:[EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re[2]: [PHP-DB] a "back" include script

2002-06-21 Thread Duncan Hill

On Fri, 21 Jun 2002, Latex Master wrote:

> DH> To manipulate the browser in such a way, you have at least two options:
> DH> 1) Make the .inc just have a link to the REFERER value from the browser.
> 
> The first one want work if the person is behing a socks server or PHP
> gets a referer diferently?

I don't know.  Do socks proxies strip the referer field out?  I would think 
that they do, but I've never worked with one.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.
Never attribute to malice that which can be adequately explained by stupidity.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Innodb and transactions.

2002-06-21 Thread Michael Bretterklieber

Hi,

use InnoDB, because InnoDB supports row-level locking, and InnoDB also 
supports referential-integrity,

bye,

Steve Bradwell schrieb:
> So should I be using Innodb tables or BDB tables?
> 
> Thanks,
> Steve.
> 
> -Original Message-
> From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 21, 2002 2:49 AM
> To: Php-Db (E-mail)
> Subject: Re: [PHP-DB] Innodb and transactions.
> 
> 
> Hi,
> 
> you have to do something like this:
> 
> mysql_query('SET AUTOCOMMIT=0');
> 
> mysql_query('COMMIT'); or mysql_query('ROLLBACK');
> mysql_query('SET AUTOCOMMIT=1');
> 
> bye,
> 
> Steve Bradwell schrieb:
> 
>>Hi all,
>>
>>I have just figured out and set up my Innodb on my mysql server so I can
> 
> use
> 
>>transactions Begin, commit, rollback. I'm now looking for examples on how
> 
> to
> 
>>do this with php. I hit the php site and the best I could find was
>>fbsql_commit etc... is this what I'm looking for? There's no documentation
>>yet. I'm using php4 with mysql 3.23.49-max, and my tables are Innodb.
>>
>>I appologize if my lingo is somewhat confusing or just wrong but I'm
> 
> pretty
> 
>>new to this stuff.
>>
>>Any input or examples would be greatly appreciated.
>>
>>Thanks,
>>Steve.
>>
>>
> 
> 
> 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
"...the number of UNIX installations has grown to 10, with more expected..."
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Innodb and transactions.

2002-06-21 Thread Steve Bradwell

Great! thanks for your help.

-Steve.

-Original Message-
From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 21, 2002 9:11 AM
To: Php-Db (E-mail)
Subject: Re: [PHP-DB] Innodb and transactions.


Hi,

use InnoDB, because InnoDB supports row-level locking, and InnoDB also 
supports referential-integrity,

bye,

Steve Bradwell schrieb:
> So should I be using Innodb tables or BDB tables?
> 
> Thanks,
> Steve.
> 
> -Original Message-
> From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 21, 2002 2:49 AM
> To: Php-Db (E-mail)
> Subject: Re: [PHP-DB] Innodb and transactions.
> 
> 
> Hi,
> 
> you have to do something like this:
> 
> mysql_query('SET AUTOCOMMIT=0');
> 
> mysql_query('COMMIT'); or mysql_query('ROLLBACK');
> mysql_query('SET AUTOCOMMIT=1');
> 
> bye,
> 
> Steve Bradwell schrieb:
> 
>>Hi all,
>>
>>I have just figured out and set up my Innodb on my mysql server so I can
> 
> use
> 
>>transactions Begin, commit, rollback. I'm now looking for examples on how
> 
> to
> 
>>do this with php. I hit the php site and the best I could find was
>>fbsql_commit etc... is this what I'm looking for? There's no documentation
>>yet. I'm using php4 with mysql 3.23.49-max, and my tables are Innodb.
>>
>>I appologize if my lingo is somewhat confusing or just wrong but I'm
> 
> pretty
> 
>>new to this stuff.
>>
>>Any input or examples would be greatly appreciated.
>>
>>Thanks,
>>Steve.
>>
>>
> 
> 
> 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
"...the number of UNIX installations has grown to 10, with more expected..."
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
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] Re: [PHP-WIN] RE: [PHP] How to Show my Own Error Message Instead of Mysql Error?

2002-06-21 Thread Chris Boget

> i made a Registration Form for user to input their Data, but i also had some
> Field Check before the data can be insert to the Mysql_Database!
> I had a question here, sometime the mysql shows the error :
> "Duplicate Key for xxx"
> I know what is this about, reguarding to my Registration Form, it mean the
> Login Name is Duplicated! But i want to show my own message to the user for
> this error instead the Mysql Error! It is meanness to show User the Mysql
> Error, cause they won't understand it!!!
> Could Someone pls tell me how i can do this?

Here's a function I use.  I just pass it the mysql_errno() and mysql_error() that
is generated with each query.  The error messages are based off the result
codes as specified on the mySQL site.  Changing these to say what you want
will be a simple matter.

hth

Chris


function setErrorMsg( $dbErrorNum, $dbErrorMessage ) {

  $dbaMessage = "";

  switch( $dbErrorNum ) {
case 1000:
   $dbaMessage .= "Error number : $dbErrorNum - hashchk";
   break;

case 1001:
   $dbaMessage .= "Error number : $dbErrorNum - isamchk";
   break;

case 1002:
   $dbaMessage .= "Error number : $dbErrorNum - NO";
   break;

case 1003:
   $dbaMessage .= "Error number : $dbErrorNum - YES";
   break;

case 1004:
   $dbaMessage .= "Can't create file '%-.64s' (errno: %d)";
   break;

case 1005:
   $dbaMessage .= "Can't create table '%-.64s' (errno: %d)";
   break;

case 1006:
   $dbaMessage .= "Can't create database '%-.64s'. (errno: %d)";
   break;

case 1007:
   $dbaMessage .= "Can't create database '%-.64s'. Database exists";
   break;

case 1008:
   $dbaMessage .= "Can't drop database '%-.64s'. Database doesn't exist";
   break;

case 1009:
   $dbaMessage .= "Error dropping database (can't delete '%-.64s', errno: %d)";
   break;

case 1010:
   $dbaMessage .= "Error dropping database (can't rmdir '%-.64s', errno: %d)";
   break;

case 1011:
   $dbaMessage .= "Error on delete of '%-.64s' (errno: %d)";
   break;

case 1012:
   $dbaMessage .= "Can't read record in system table.";
   break;

case 1013:
   $dbaMessage .= "Can't get status of '%-.64s' (errno: %d)";
   break;

case 1014:
   $dbaMessage .= "Can't get working directory (errno: %d)";
   break;

case 1015:
   $dbaMessage .= "Can't lock file (errno: %d)";
   break;

case 1016:
   $dbaMessage .= "Can't open file: '%-.64s'. (errno: %d)";
   break;

case 1017:
   $dbaMessage .= "Can't find file: '%-.64s' (errno: %d)";
   break;

case 1018:
   $dbaMessage .= "Can't read dir of '%-.64s' (errno: %d)";
   break;

case 1019:
   $dbaMessage .= "Can't change dir to '%-.64s' (errno: %d)";
   break;

case 1020:
   $dbaMessage .= "Record has changed since last read in table '%-.64s'";
   break;

case 1021:
   $dbaMessage .= "Disk full.";
   break;

case 1022:
   $dbaMessage .= "This duplicate record could not be added to the database.";
   break;

case 1023:
   $dbaMessage .= "Error on close of '%-.64s' (errno: %d)";
   break;

case 1024:
   $dbaMessage .= "Error reading file '%-.64s' (errno: %d)";
   break;

case 1025:
   $dbaMessage .= "Error on rename of '%-.64s' to '%-.64s' (errno: %d)";
   break;

case 1026:
   $dbaMessage .= "Error writing file '%-.64s' (errno: %d)";
   break;

case 1027:
   $dbaMessage .= "'%-.64s' is locked against change";
   break;

case 1028:
   $dbaMessage .= "Sort aborted.";
   break;

case 1029:
   $dbaMessage .= "View '%-.64s' doesn't exist for '%-.64s'";
   break;

case 1030:
   $dbaMessage .= "Got error %d from table handler";
   break;

case 1031:
   $dbaMessage .= "Table handler for '%-.64s' doesn't have this option";
   break;

case 1032:
   $dbaMessage .= "Could not find the record that was requested.";
   break;

case 1033:
   $dbaMessage .= "Incorrect information in file: '%-.64s'";
   break;

case 1034:
   $dbaMessage .= "Key file for table is currupt.";
   break;

case 1035:
   $dbaMessage .= "Old key file for table '%-.64s'; Repair it!";
   break;

case 1036:
   $dbaMessage .= "Table '%-.64s' is read only";
   break;

case 1037:
   $dbaMessage .= "Out of memory.";
   break;

case 1038:
   $dbaMessage .= "Out of sort memory. Increase daemon sort buffer size.";
   break;

case 1039:
   $dbaMessage .= "Unexpected eof found when reading file '%-.64s' (errno: %d)";
   break;

case 1040:
   $dbaMessage .= "Too many connections.";
   break;

case 1041:
   $dbaMessage .= "Out of memory;  Check if mysqld or some other process uses all 
available memory. If not you may hav

[PHP-DB] Re: intercative selection menu

2002-06-21 Thread Stephen Rhodes

You could have if statements for every option.
May be better if you have a for loop for some of the options -- SEE BELOW.

e.g

:

 %s",$i);
}
  printf(" 1916");

  printf(" volta");

  printf(" scatt11");
?>



Cheers
Steve



"Walid Dib" <[EMAIL PROTECTED]> wrote in message
6EDD9DC298BF9C48AC3EF66EA92596BC0463AF25@frbucmsx03medge">news:6EDD9DC298BF9C48AC3EF66EA92596BC0463AF25@frbucmsx03medge...
> Hello, I need to  get back the present value in the data base and to
> post(show) it in the menu of selection.  somebody has an idea??
>
> Thank you in advance.
> :
>   
>1904
>1905
>1906
>1907
>1908
>1909
>1910
>1911
>1916
>volta
>scatt11
>   
> 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Innodb and transactions.

2002-06-21 Thread Paul DuBois

At 8:55 -0400 6/21/02, Steve Bradwell wrote:
>So should I be using Innodb tables or BDB tables?

You have to be using *some* kind of transaction-safe tables (InnoDB
and BDB qualify).  If you use a table type like MyISAM, then all
statements are committed as they execute, and use of a transaction
has no meaning.

Also, another way to perform a transaction (besides that shown below)
is to use BEGIN to begin it and COMMIT or ROLLBACK to end it.
The difference is that you don't need to modify the AUTOCOMMIT
mode explicitly; BEGIN suspends it temporarily until the transaction
has been ended with COMMIT or ROLLBACK.

>
>Thanks,
>Steve.
>
>-Original Message-
>From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]]
>Sent: Friday, June 21, 2002 2:49 AM
>To: Php-Db (E-mail)
>Subject: Re: [PHP-DB] Innodb and transactions.
>
>
>Hi,
>
>you have to do something like this:
>
>mysql_query('SET AUTOCOMMIT=0');
>
>mysql_query('COMMIT'); or mysql_query('ROLLBACK');
>mysql_query('SET AUTOCOMMIT=1');
>
>bye,
>
>Steve Bradwell schrieb:
>>  Hi all,
>>
>>  I have just figured out and set up my Innodb on my mysql server so I can
>use
>>  transactions Begin, commit, rollback. I'm now looking for examples on how
>to
>>  do this with php. I hit the php site and the best I could find was
>>  fbsql_commit etc... is this what I'm looking for? There's no documentation
>>  yet. I'm using php4 with mysql 3.23.49-max, and my tables are Innodb.
>>
>>  I appologize if my lingo is somewhat confusing or just wrong but I'm
>pretty
>>  new to this stuff.
>>
>>  Any input or examples would be greatly appreciated.
>>
>>  Thanks,
>>  Steve.
>  >
>>
>
>
>--
>--
>Michael Bretterklieber
>LCP
>JAWA Management Software GmbH
>Liebenauer Hauptstr. 200
>A-8041 GRAZ
>Tel: ++43-(0)316-403274-12
>Fax: ++43-(0)316-403274-10
>GSM: ++43-(0)676-93 96 698
>[EMAIL PROTECTED]
>homepage: http://www.jawa.at
>- privat ---
>E-mail:   [EMAIL PROTECTED]
>homepage: http://www.inode.at/mbretter
>--
>"...the number of UNIX installations has grown to 10, with more expected..."
>  - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL and datatime field and displaying on page

2002-06-21 Thread Charlie Grosvenor

Hi
I have a mysql table that has a field in it called 'DATETIMEADDED' which
has data type 'datetime' I want to display the contents of the field on my
page. I have tried usng the following code but the value in the
'DATETIMEADDED' only the value in the 'NAME' field which is a varchar is
displayed on the page. How can i get it to display the value in
'DATETIMEADDED'?









Thank you

Charlie



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Populating multi-select list from mysql

2002-06-21 Thread Jason Wong

On Friday 21 June 2002 10:31, bob wrote:
> Hi all,
>
> I'm having problems getting my multi-select list populated from a mysql
> table. There is a table called categories with 2 columns (id and category).
> I want to get all the items (category) and list them in the multi-select
> list box.
>
> This is the code I have so far:
>
> $sql = "SELECT category FROM categories";
>
> $result = mysql_query($sql, $connection);
>
> while ($row = mysql_fetch_array($result)) {
>$id = $row['id'];
>$category = $row['category'];
>$category_list .= "$category";
>}
> ?>

Here your $category_list will be a string like 'Category1Category2...', which 
is probably not what you want.

>
> 
>  for ($i=0; $i ?>
>   >
>
> 
> 
>
>
> Now, if I echo $category_list to the page I can see I have the correct
> data, I just can't get it into the list box. I've seem to hit a wall on any
> different ways to try and make this work. What am I doing wrong?

Instead of doing two loops (while and for) just have a single while loop, 
build your  inside the while loop.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
NOWPRINT. NOWPRINT. Clemclone, back to the shadows again.
- The Firesign Theater
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL and datatime field and displaying on page

2002-06-21 Thread Jason Wong

On Friday 21 June 2002 21:42, Charlie Grosvenor wrote:
> Hi
> I have a mysql table that has a field in it called 'DATETIMEADDED'
> which has data type 'datetime' I want to display the contents of the field
> on my page. I have tried usng the following code but the value in the
> 'DATETIMEADDED' only the value in the 'NAME' field which is a varchar is
> displayed on the page. How can i get it to display the value in
> 'DATETIMEADDED'?
>
> 
>  $query = "SELECT *  FROM `BOARDITEMS` WHERE BOARDID=$BOARDID ORDER
> BY 'DATETIMEADDED';";

The above should NOT have a semi-colon at the end. Assuming that this is the 
problem I don't see how you can display the value of the NAME field as your 
query is invalid and should not return any results.

If that's not the problem then ...

> $resultboarditems = mysql_query ($query) or die("Invalid Result
> Set");
> while ($row = mysql_fetch_array ($resultboarditems)) {
> ?>
>  $row["NAME"]; ?>

do

  print_r($row);


to see what it contains.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
It'll be just like Beggars' Canyon back home.
-- Luke Skywalker
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] E-mail address verification

2002-06-21 Thread Jason Wong

On Thursday 20 June 2002 23:59, [EMAIL PROTECTED] wrote:

> As you can see, the email can "look" right, but domain isn't valid. So you
> can check DNS record for MX domain.

A valid email address does not necessary have to have an MX record. You could 
be incorrectly invalidating addresses like this.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
I've got a very bad feeling about this.
-- Han Solo
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Can I be an ASP with PHP?

2002-06-21 Thread olinux

You can connect to remote servers - but i'm guesssing
that this will be a much more difficult route.
Especially with customers that will be on shared
servers (unless you licensed to the hosting
companies...)

read the manual for mysql_coonect
mysql_connect (server, username, password)

olinux



--- René_Fournier <[EMAIL PROTECTED]> wrote:
> I have a question to which I'm pretty sure the
> answer will be "no", but 
> I would like to hope I'm wrong...
> 
> I've developed a very simple Content Management
> tool--called 
> "Europa"--that even retarded monkeys can use to
> change/update text in 
> their web site. It's web-based, user-authenticated
> (sessions), and runs 
> with PHP4 and MySQL.
> 
> Now, Europa is pretty much plug and play, so long as
> the web site is 
> getting its text from a MySQL database. There's a
> web agency in town 
> that is interested in Europa for their clients.
> Their clients want to be 
> able to easily and quickly update certain elements
> of their site without 
> begging some outside webmaster. They would really
> benefit from Europa.
> 
> Problem: I don't want to "sell" Europa, or even
> install it on someone's 
> web server for a one-time fee. I've spent a long
> time on this little 
> tool, and want to continue to improve it. So, I
> would rather license it 
> to companies. They pay a quarterly subscription fee,
> and get to use 
> Europa as it continues to grow and improve.  I'm
> just a little worried 
> about one thing: If I install Europa on their
> server, and they pay their 
> paltry quarterly subscription fee, and then decide
> they don't need any 
> updates, I'm screwed. The value of Europa is much
> greater than what I 
> want to sell subscriptions to it for (not much--I'm
> not really greedy), 
> but I need some kind of control.
> 
> The idea: In order for Joe User to update text on
> his web site, he comes 
> to my "Europa" web site, enters his company name,
> user ID, password, and 
> clicks Login, and--voilà--he sees a handsome list of
> tables containing 
> the text content of his site--which is pulled from a
> MySQL database 
> residing on HIS web site's web host.
> 
> And this is the trick: Can PHP somehow fetch MySQL
> data over the 
> Internet? Is this possible? If so, is it necessary
> for me to resort to 
> new, unknown technologies like XML or SOAP, or can I
> do it with PHP 
> alone?
> 
> Thanks for your comments.
> 
> ...Rene
> 
> ---
> René Fournier,
> [EMAIL PROTECTED]
> 
> Toll-free +1.888.886.2754
> Tel +1.403.291.3601
> Fax +1.403.250.5228
> www.smartslitters.com
> 
> SmartSlitters International
> #33, 1339 - 40th Ave NE
> Calgary AB  T2E 8N6
> Canada
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] array problem

2002-06-21 Thread Jason Wong

On Thursday 20 June 2002 23:26, Richard Black wrote:
> By passing a second parameter to mysql_fetch_array, MYSQL_ASSOC
>
> This means you only get back an array with the values indexed by
> fieldname.

Or just use mysql_fetch_assoc().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
disks spinning backwards - toggle the hemisphere jumper.
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Creating an email form

2002-06-21 Thread Jason Wong

On Wednesday 19 June 2002 10:35, Tim Best wrote:
> I am creating an HTML form that one will fill out, upload their resume,
> write a message, give their reply-to email address and send the email to me
> with the uploaded file as an attachment.
>
> I know I have to create the email message with mime, but I'm not sure what
> the mime type would be for a word file and a pdf file at the same time.
> Also I'm unsure of the logical structure that the script would take since
> this is my first time using MIME...

Unless you want to re-invent the wheel, look for some ready made classes which 
implements mail:

http://phpclasses.gremlins.com.hk

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
Smile!  You're on Candid Camera.
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Can I be an ASP with PHP?

2002-06-21 Thread SP

If your database server is on a remote server then expect the page to take
even longer to render since it will take time to send the database query
info back and forth between the two servers.



-Original Message-
From: olinux [mailto:[EMAIL PROTECTED]]
Sent: June 21, 2002 11:06 AM
To: René_Fournier; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Can I be an ASP with PHP?


You can connect to remote servers - but i'm guesssing
that this will be a much more difficult route.
Especially with customers that will be on shared
servers (unless you licensed to the hosting
companies...)

read the manual for mysql_coonect
mysql_connect (server, username, password)

olinux



--- René_Fournier <[EMAIL PROTECTED]> wrote:
> I have a question to which I'm pretty sure the
> answer will be "no", but
> I would like to hope I'm wrong...
>
> I've developed a very simple Content Management
> tool--called
> "Europa"--that even retarded monkeys can use to
> change/update text in
> their web site. It's web-based, user-authenticated
> (sessions), and runs
> with PHP4 and MySQL.
>
> Now, Europa is pretty much plug and play, so long as
> the web site is
> getting its text from a MySQL database. There's a
> web agency in town
> that is interested in Europa for their clients.
> Their clients want to be
> able to easily and quickly update certain elements
> of their site without
> begging some outside webmaster. They would really
> benefit from Europa.
>
> Problem: I don't want to "sell" Europa, or even
> install it on someone's
> web server for a one-time fee. I've spent a long
> time on this little
> tool, and want to continue to improve it. So, I
> would rather license it
> to companies. They pay a quarterly subscription fee,
> and get to use
> Europa as it continues to grow and improve.  I'm
> just a little worried
> about one thing: If I install Europa on their
> server, and they pay their
> paltry quarterly subscription fee, and then decide
> they don't need any
> updates, I'm screwed. The value of Europa is much
> greater than what I
> want to sell subscriptions to it for (not much--I'm
> not really greedy),
> but I need some kind of control.
>
> The idea: In order for Joe User to update text on
> his web site, he comes
> to my "Europa" web site, enters his company name,
> user ID, password, and
> clicks Login, and--voilà--he sees a handsome list of
> tables containing
> the text content of his site--which is pulled from a
> MySQL database
> residing on HIS web site's web host.
>
> And this is the trick: Can PHP somehow fetch MySQL
> data over the
> Internet? Is this possible? If so, is it necessary
> for me to resort to
> new, unknown technologies like XML or SOAP, or can I
> do it with PHP
> alone?
>
> Thanks for your comments.
>
> ...Rene
>
> ---
> René Fournier,
> [EMAIL PROTECTED]
>
> Toll-free +1.888.886.2754
> Tel +1.403.291.3601
> Fax +1.403.250.5228
> www.smartslitters.com
>
> SmartSlitters International
> #33, 1339 - 40th Ave NE
> Calgary AB  T2E 8N6
> Canada
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
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




RE: [PHP-DB] Populating multi-select list from mysql

2002-06-21 Thread Gary . Every



Hi all,

I'm having problems getting my multi-select list populated from a mysql
table. There is a table called categories with 2 columns (id and category).
I want to get all the items (category) and list them in the multi-select
list box.

This is the code I have so far:

$sql = "SELECT category FROM categories";

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

//Try This instead of the while statement
foreach($result as $row) {
echo '' . $row['category'];
}
echo '';





while ($row = mysql_fetch_array($result)) {
   $id = $row['id'];
   $category = $row['category'];
   $category_list .= "$category";
   }
?>




  >





Now, if I echo $category_list to the page I can see I have the correct data,
I just can't get it into the list box. I've seem to hit a wall on any
different ways to try and make this work. What am I doing wrong?

Thanks.

Rob.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Populating multi-select list from mysql

2002-06-21 Thread Ryan Jameson (USA)

You're logic seems to make sense. The output (page source) you are getting would help. 
:-)
<>< Ryan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, June 21, 2002 10:06 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Populating multi-select list from mysql




Hi all,

I'm having problems getting my multi-select list populated from a mysql
table. There is a table called categories with 2 columns (id and category).
I want to get all the items (category) and list them in the multi-select
list box.

This is the code I have so far:

$sql = "SELECT category FROM categories";

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

//Try This instead of the while statement
foreach($result as $row) {
echo '' . $row['category'];
}
echo '';





while ($row = mysql_fetch_array($result)) {
   $id = $row['id'];
   $category = $row['category'];
   $category_list .= "$category";
   }
?>




  >





Now, if I echo $category_list to the page I can see I have the correct data,
I just can't get it into the list box. I've seem to hit a wall on any
different ways to try and make this work. What am I doing wrong?

Thanks.

Rob.


-- 
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




RE: [PHP-DB] Populating multi-select list from mysql

2002-06-21 Thread Martin Clifford

Whenever you are having trouble with your PHP pages, always echo!  By doing this, you 
can see whether or not the query is formatted correctly, whether or not the variables 
are containing the values you think they are.  It's incredibly helpful, no matter what 
the situation.

Martin

>>> "Ryan Jameson (USA)" <[EMAIL PROTECTED]> 06/21/02 12:10PM >>>
You're logic seems to make sense. The output (page source) you are getting would help. 
:-)
<>< Ryan

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]] 
Sent: Friday, June 21, 2002 10:06 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED] 
Subject: RE: [PHP-DB] Populating multi-select list from mysql




Hi all,

I'm having problems getting my multi-select list populated from a mysql
table. There is a table called categories with 2 columns (id and category).
I want to get all the items (category) and list them in the multi-select
list box.

This is the code I have so far:

$sql = "SELECT category FROM categories";

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

//Try This instead of the while statement
foreach($result as $row) {
echo '' . $row['category'];
}
echo '';





while ($row = mysql_fetch_array($result)) {
   $id = $row['id'];
   $category = $row['category'];
   $category_list .= "$category";
   }
?>




  >





Now, if I echo $category_list to the page I can see I have the correct data,
I just can't get it into the list box. I've seem to hit a wall on any
different ways to try and make this work. What am I doing wrong?

Thanks.

Rob.


-- 
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Innodb and transactions.

2002-06-21 Thread Josh Trutwin

One other obvious thing to remember is that you need to to use:

create table (int id blah blah blah) type = InnoDB;

Also, to take advantage of these features you will also need to update
your /etc/my.cnf file (assuming you run some *nix flavored OS) so the
InnoDB files are created on disk.  I found that very slowly reading
through the online docs at mysql.com/doc (see section 7.5.2) was adequate
to get started.  If you don't do this step and you try to create a InnoDB
table, MySQL will just create a regular MyISAM table, but it won't even
tell you it did that!  Not very helpful.  You can execute a "SHOW TABLE
STATUS" to see what kind of table MySQL really created though.
FYI, MySQL 3.23.51 also has InnoDB support for Foriegn Keys and Delete On
Cascade, something I'm really excited to finally see in MySQL.
Anyway, enough blabber.  Hope you enjoy InnoDB, it's a little tough to get
going, but solid once it's setup.
Josh

> Hi,
>
> use InnoDB, because InnoDB supports row-level locking, and InnoDB also
> supports referential-integrity,
>
> bye,
>
> Steve Bradwell schrieb:
>> So should I be using Innodb tables or BDB tables?
>>
>> Thanks,
>> Steve.
>>
>> -Original Message-
>> From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, June 21, 2002 2:49 AM
>> To: Php-Db (E-mail)
>> Subject: Re: [PHP-DB] Innodb and transactions.
>>
>>
>> Hi,
>>
>> you have to do something like this:
>>
>> mysql_query('SET AUTOCOMMIT=0');
>> 
>> mysql_query('COMMIT'); or mysql_query('ROLLBACK');
>> mysql_query('SET AUTOCOMMIT=1');
>>
>> bye,
>>
>> Steve Bradwell schrieb:
>>
>>>Hi all,
>>>
>>>I have just figured out and set up my Innodb on my mysql server so I
>>>can
>>
>> use
>>
>>>transactions Begin, commit, rollback. I'm now looking for examples on
>>>how
>>
>> to
>>
>>>do this with php. I hit the php site and the best I could find was
>>>fbsql_commit etc... is this what I'm looking for? There's no
>>>documentation yet. I'm using php4 with mysql 3.23.49-max, and my
>>>tables are Innodb.
>>>
>>>I appologize if my lingo is somewhat confusing or just wrong but I'm
>>
>> pretty
>>
>>>new to this stuff.
>>>
>>>Any input or examples would be greatly appreciated.
>>>
>>>Thanks,
>>>Steve.
>>>
>>>
>>
>>
>>
>
>
> --
> --
> Michael Bretterklieber
> LCP
> JAWA Management Software GmbH
> Liebenauer Hauptstr. 200
> A-8041 GRAZ
> Tel: ++43-(0)316-403274-12
> Fax: ++43-(0)316-403274-10
> GSM: ++43-(0)676-93 96 698
> [EMAIL PROTECTED]
> homepage: http://www.jawa.at
> - privat ---
> E-mail:   [EMAIL PROTECTED]
> homepage: http://www.inode.at/mbretter
> --
> "...the number of UNIX installations has grown to 10, with more
> expected..."
>  - Dennis Ritchie and Ken Thompson, June 1972
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


Josh Trutwin
http://trutwins.homeip.net



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Populating multi-select list from mysql

2002-06-21 Thread bob

Thanks for all the help. I got it working using the following code from
Martin.

Rob.


$sql = "SELECT category FROM categories";

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

echo "\n";

while ($row = mysql_fetch_array($result)) {
   $id = $row['id'];
   $category = $row['category'];

   echo "$category\n";

   }

   echo "\n\n";
?>

-Original Message-
From: Martin Clifford [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 21, 2002 12:20 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Populating multi-select list from mysql


Whenever you are having trouble with your PHP pages, always echo!  By doing
this, you can see whether or not the query is formatted correctly, whether
or not the variables are containing the values you think they are.  It's
incredibly helpful, no matter what the situation.

Martin

>>> "Ryan Jameson (USA)" <[EMAIL PROTECTED]> 06/21/02 12:10PM >>>
You're logic seems to make sense. The output (page source) you are getting
would help. :-)
<>< Ryan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, June 21, 2002 10:06 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Populating multi-select list from mysql




Hi all,

I'm having problems getting my multi-select list populated from a mysql
table. There is a table called categories with 2 columns (id and category).
I want to get all the items (category) and list them in the multi-select
list box.

This is the code I have so far:

$sql = "SELECT category FROM categories";

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

//Try This instead of the while statement
foreach($result as $row) {
echo '' . $row['category'];
}
echo '';





while ($row = mysql_fetch_array($result)) {
   $id = $row['id'];
   $category = $row['category'];
   $category_list .= "$category";
   }
?>




  >





Now, if I echo $category_list to the page I can see I have the correct data,
I just can't get it into the list box. I've seem to hit a wall on any
different ways to try and make this work. What am I doing wrong?

Thanks.

Rob.


--
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 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] MYSQL Socket error :\

2002-06-21 Thread Marco Lanini

Hi

sorry for my english but i'm italian.

I have a server who run with

WIN XP HOME
Abyss Web Server (Freeware) www.aprelium.com
MySql 4.0.1-alpha-nt
PHP 4.2.1

when i use mysql_connect($host,$user,$pass) or die(mysql_error()); function

he write:

Can't create TCP/IP socket (10106)

i have searched explanations on the internet but unfotunately i haven't find
out nothing.

thanks for your help.




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MYSQL Socket error :\

2002-06-21 Thread Dan Harrington

I'm no expert on XP, but you may want to check
the firewall settings, to make sure that windows XP
isn't preventing the connection.  

For the $host, you may want to either use
'localhost' or 127.0.0.1

Cheers,
Dan


> -Original Message-
> From: Marco Lanini [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 21, 2002 11:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] MYSQL Socket error :\
> 
> 
> Hi
> 
> sorry for my english but i'm italian.
> 
> I have a server who run with
> 
> WIN XP HOME
> Abyss Web Server (Freeware) www.aprelium.com
> MySql 4.0.1-alpha-nt
> PHP 4.2.1
> 
> when i use mysql_connect($host,$user,$pass) or die(mysql_error()); function
> 
> he write:
> 
> Can't create TCP/IP socket (10106)
> 
> i have searched explanations on the internet but unfotunately i haven't find
> out nothing.
> 
> thanks for your help.
> 
> 
> 
> 
> -- 
> 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] Finding numbers in a string

2002-06-21 Thread user

Hello all -

I am trying to seperate numberic characters from a string.  The book I 
was looking at described something like this:


if(ereg("[[:alnum]]+", $textandnumbers, $numbers)) {
print("$numbers");
  }


When I run my script I receive this error:

Warning: REG_ECTYPE in ../mypage.php


Anyone have a solution / explanation to my problem

  - still reading


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] BBS program

2002-06-21 Thread Todd Cary

I would like to avoid reinventing the wheel and find an existing BBS program.
Do these exist?

Thank you

--
Todd Cary
Ariste Software
2200 D Street Extension
Petaluma, CA 94952
707-773-4523
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] BBS program

2002-06-21 Thread Ryan Jameson (USA)

BBS = Backyard Bible Study?

-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 21, 2002 11:40 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] BBS program


I would like to avoid reinventing the wheel and find an existing BBS program.
Do these exist?

Thank you

--
Todd Cary
Ariste Software
2200 D Street Extension
Petaluma, CA 94952
707-773-4523
[EMAIL PROTECTED]



-- 
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




Re: [PHP-DB] BBS program

2002-06-21 Thread Chris Boget

> I would like to avoid reinventing the wheel and find an existing BBS program.
> Do these exist?

You could probably take a look at PHPNuke or something along those lines.

Chris



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] BBS program

2002-06-21 Thread Martin Clifford

One of the best PHP Message Boards around is Invision Boards 
(http://www.invisionboard.com).  It's made by the same person who made IkonBoard.

For an example check out my boards, which are still in development (I'm slow, what can 
I say? hehe):

http://www.completesource.net/forums/ 

Martin

>>> "Chris Boget" <[EMAIL PROTECTED]> 06/21/02 01:42PM >>>
> I would like to avoid reinventing the wheel and find an existing BBS program.
> Do these exist?

You could probably take a look at PHPNuke or something along those lines.

Chris



-- 
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




Re: [PHP-DB] BBS program

2002-06-21 Thread Chris Boget

> BBS = Backyard Bible Study?

Heh.  Good guess.  BBS = Bulliten Board System.

Chris



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] RE: [PHP] Re: ARRAY, IF & INSERT

2002-06-21 Thread César Aracena

Thanks for the input. I wasn't considering the possibility of making a
new table for kids until now which seems pretty logic when trying to
save space. The only thing missing now is how to assign a unique
relation number for each kid/relative. That's 1 for the first born, 2
for the second one, etc... and it can't be done by auto_incrementing,
for it will start over when a new member is inserted... i.e. the
relatives table should show:

Member  level   nameaddress 
00251   Jr.1same as 0025/0
00252   Jr.2same as 0025/0
00261   Jr.1same as 0026/0
00262   Jr.2same as 0026/0
00263   Jr.3same as 0026/0

The catch would be to make PHP to auto assign the relatives "level" by
knowing it has to start from $i=1 and loop $i++ until no other kid is
inserted. Now that I write it, it seems I could use a for loop, but what
should be the structure of it using the $name <> 0 you told me?

Thanks

> -Original Message-
> From: Jesper Brunholm [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 21, 2002 6:56 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] Re: ARRAY, IF & INSERT
> 
> (i am new to these groups, but shouldn't there be a follow-up-to on a
> X-post?)
> 
> César aracena wrote:
> > I have this form in which one Administrator can insert new members
and
> > after that, in another page, a form where he/she can insert the new
> > member’s sons & daughters. I want to display a table with “text
inserts”
> > into the admin can type let’s say a maximum of 5 kids in the second
> > page.
> 
> The number doesn't matter if you design you db well (I suppose we are
> talking database).
> 
> I suppose that you have a table with members with unique ID's?
> 
> Make a new table with relatives, where you connect to their parents
> through a ParentID-field
> 
> This way you'll avoid empty fields for the folks with eg. only 2 sons
:-)
> 
> The query for father + sons and daughters would then be like
> 
> mysql_query("
> select members.Name, members.ID, relatives.Name as RelativeName,
> relatives.ID
> from parents, relatives
> where parents.ID = relatives.ParentID
> ")
> 
> The “members” table will have one memberID field (which will be
> > shared between parents and kids) and a levelID which will grant 0
for
> > the parent and 1, 2, 3, 4, 5 for the kids.
> 
> You _can_ put them all in the same table, but I suppose that you have
a
> lot of data stored on the parents/members, that is non-existing and
> irellevant for the children - this will give a lot of empty fields,
> which is why i propose the solution above...
> 
> > Now, how do I tell PHP to make an array from the kids input, but
only
> > from the fields in which let’s say the “name” field was filled out
in
> > order to spend the necessary table’s rows. Another thing… the Array
> > should also specify new levelID’s for each kid from 1 to 5. It would
be
> > great if you also show me how to deal with it after it’s created.
> 
> It's easy to select only rows with contents for at certain field:
> 
> select * from relatives
> where Name <> 0
> 
> I hope this was of some help?
> 
> regards
> 
> Jesper Brunholm
> 
> --
> Phønix - Danish folkmusic from young musicians -
http://www.phonixfolk.dk
> 
> 
> --
> PHP General 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] Finding numbers in a string

2002-06-21 Thread Seth Yount

Forgot my email on that last one ;)

Hello all -

I am trying to seperate numberic characters from a string.  The book I 
was looking at described something like this:


if(ereg("[[:alnum]]+", $textandnumbers, $numbers)) {
 print("$numbers");
  }


When I run my script I receive this error:

Warning: REG_ECTYPE in ../mypage.php


Anyone have a solution / explanation to my problem

  - still reading


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] BBS program

2002-06-21 Thread Daniel Brunner

AHAHAHAH

Now that was funny!!

Do any of you remember the game Nuk'em?? That was a Blast!!

Dan


On Friday, June 21, 2002, at 12:50 PM, [EMAIL PROTECTED] wrote:

>> BBS = Backyard Bible Study?
>
> Heh.  Good guess.  BBS = Bulliten Board System.
>
> Chris
>
>
>
> --
> 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] help with $_Get in form

2002-06-21 Thread Mike Germain

I'm trying to get a partnum field into a select statement but i'm not
getting anything passed into the varable. i'm sure it's a simple fix but i
can't find it.
thx
mike



Inventory Lookup
  
  






 PartNum:
 



";
exit; } else { echo "Connection successful\n"; };
$query = "SELECT whs,loc,miprod,mndesc,onhand FROM npshrlib_prdinv1 where
miprod = '$partnum' ";
$result = odbc_exec($conn, $query);
odbc_result_all($result);


?>





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] help with $_Get in form

2002-06-21 Thread Matt Babineau

Just from quickly looking you are trying to submit a form and grab the
submitted value and stick it into the DB?

If so try using METHOD="POST" on your form, and using the variable
$_POST["form_field"] in the insert statement

Matt Babineau
MCWD / CCFD
-
e: [EMAIL PROTECTED]
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105


-Original Message-
From: Mike Germain [mailto:[EMAIL PROTECTED]] 
Sent: Friday, June 21, 2002 2:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] help with $_Get in form


I'm trying to get a partnum field into a select statement but i'm not
getting anything passed into the varable. i'm sure it's a simple fix but
i can't find it. thx mike



Inventory Lookup
  
  






 PartNum:
 



"; exit; }
else { echo "Connection successful\n"; }; $query = "SELECT
whs,loc,miprod,mndesc,onhand FROM npshrlib_prdinv1 where miprod =
'$partnum' "; $result = odbc_exec($conn, $query);
odbc_result_all($result);


?>





-- 
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




Re: [PHP-DB] MySQL Query Acting Up

2002-06-21 Thread William Fong

I would suggest using ' instead of " for SQL queries... That's what I use...
so much easier.

$query = "UPDATE articles2 SET title='$title', brief='$brief',
doclink='$doclink' WHERE article_id='$id'";

Then I would print the query:

print( "$query\n" );

Then if it still looks right, try manually typing it in a CLI interface.

-w



--
William Fong - [EMAIL PROTECTED]
Phone: 626.968.6424 x210  |  Fax: 626.968.6877
Wireless #: 714.315.8954|  Wireless E-mail:


- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 20, 2002 10:03 AM
Subject: [PHP-DB] MySQL Query Acting Up


Howdy all,

If someone call tell me why this MySQL query is not working, I'd be VERY
thankful.  I don't see a damn thing wrong with it, but I could have been
looking at it too long.

Here is the query:

$query = "UPDATE articles2 SET title=\"$title", brief=\"$brief\",
doclink=\"$doclink\" WHERE article_id=\"$id\"";
$result = mysql_query($query, $connect)
 or die(mysql_error());

No errors are produced, yet the query doesn't do anything.  Nothing in the
row changes.  Any help would be appreciated!

Martin


--
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




Re: [PHP-DB] help with $_Get in form

2002-06-21 Thread Jeffrey_N_Dyke


The method is right, for your form, the problem is the lowercase $_get, I
believe.  use $_GET['formfield']

Jeff


   
   
"Mike Germain" 
   
 cc: 
   
   Subject: [PHP-DB] help with $_Get in 
form  
06/21/2002 02:24   
   
PM 
   
   
   
   
   




I'm trying to get a partnum field into a select statement but i'm not
getting anything passed into the varable. i'm sure it's a simple fix but i
can't find it.
thx
mike



Inventory Lookup
  
  






 PartNum:
 



";
exit; } else { echo "Connection successful\n"; };
$query = "SELECT whs,loc,miprod,mndesc,onhand FROM npshrlib_prdinv1 where
miprod = '$partnum' ";
$result = odbc_exec($conn, $query);
odbc_result_all($result);


?>





--
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] MSSQL

2002-06-21 Thread Gerard Samuel

I just starting with mssql coming from a mysql background.
Im looking for tutorials and such on how to get scripts working with php.
The server is IIS 5 with php 4.2.1 and mssql 2000.  phpinfo() shows that 
mssql is recognised.
Im not sure if I have to jump through hoops like how I did when I first 
started with mysql in setting up
users for each database with mssql.  But any resources would be greatly 
appreciated.
Meantime, Ill start with the manual and user feedback comments...
Thanks

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] retrieving all information from a single table

2002-06-21 Thread Jonathan

Hello everyone,
I am brand new to php, so any replies I get are very much appreciated.
My goal is to retrieve one entire table from my database and post the
information on the web.  My query seems successful, but I am having trouble
getting the information out from the variable $result.  My table has 4
fields, the primary key, "location," "organization," and "charge."   Any
suggestions?   A million thanks.  Here is the code:



";
echo $row[i["location"]."";
 echo $row[i]["charge"];
  }
}

?>



-- Jonathan



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Emulating HTTP File Uploads

2002-06-21 Thread Georgie Casey

Does anyone know how to upload a file through PHP through the HTT interface.
I use fopen() to open remote php scripts using the GET method for non-file
uploads but it doesnt work with HTTP POST or file uploads.

Does anyone have any ideas?

--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Online Film Production Directory
***



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] [Q] EXT SQL IN PostgreSQL

2002-06-21 Thread brown

# Sorry to my poor English

I have a procedure ( named by select_table )

##
BEGIN;
select select_table('select_cur','table_name');
FETCH ALL IN select_cur;
COMMIT;
##

This Query is right In Console (psql).

I wanna see a result with php.

$sql = "
BEGIN;
select select_table('select_cur','table_name');
FETCH ALL IN select_cur;
COMMIT;
";
$result = pg_exec($connect,$sql);
$row = pg_fetch_row($result);

is not run.

How can I get the CURSOR from PostgreSQL with PHP ?










-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Converting values from text to numerical

2002-06-21 Thread Adam Royle

Hi Matt,

I think this might be the answer to your problem. It basically checks if 
the string is an integer. I generally love the PHP automatic type 
conversion, but sometimes it can trick ya :)

if (intval($val) == $val){
// integer stuff
} else {
// string stuff
}

Adam

> Hi Russ,
>
> thanks for the reply ...  if that will evaluate whether a (in this 
> case) a
> text string is an integer or not, then its exactly what I need! :)
>
> if it doesnt work, I will post a more detailed example to the list and 
> see
> what we can come up with! :)


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] how expensive is mysql_connect in performance

2002-06-21 Thread Michael Zornek

I'm just getting into some stuff where I seem to be making a lot of
mysql_connect and mysql_close calls. I wonder, how taxing is this on the
server?

Is there any performance test of PHP/MySQL out there I could run on my
development or deployment machines?

~ Mike
-- 
Mike Zornek | Project Leader
Apple Student Developers
The Insanely Great Site with the Insanely Long URL
http://www.applestudentdevelopers.org

Personal Site: 
http://www.mikezornek.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Populating multi-select list from mysql

2002-06-21 Thread Adam Royle

Hi Bob,

I have written some functions which make select lists much easier. I 
have two functions:
- BuildQuickSelect() - you pass a couple of parameters (tablename, etc)
- BuildSelectMenu() - you pass $sql and some more parameters

Unfortunately, they require a few things (such as other functions I have 
written). Fortunately, I have them all in one lib.php file, and you are 
welcome to use it. I think you will find it very handy and time-saving. 
I COULDN'T do without them. Look through the whole file, and you might 
see some other handy ones in there too.

There are four variables at the top of the lib.php file, which you must 
set according to your server setup (server, username, password, etc).

To use the stuff, simply include() it at the top of each page.

And to solve your problem (using the lib.php file), all you have to do 
is this:

BuildQuickSelect("category_list_array[]","categories","","multiple 
size=10");

And voila... all is done...

Need any help... ask

Oh yeah, btw everyone else, I have emailed the lib.php file to Bob - if 
you want a copy, email me.

Adam




lib.php.zip
Description: Zip archive

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] how expensive is mysql_connect in performance

2002-06-21 Thread Paul DuBois

At 22:39 -0400 6/21/02, Michael Zornek wrote:
>I'm just getting into some stuff where I seem to be making a lot of
>mysql_connect and mysql_close calls. I wonder, how taxing is this on the
>server?

Not very.  MySQL's connection-establishment sequence is pretty
efficient.  mysql_pconnect() by contrast, can use up a lot of connection
slots for a busy web site.

>
>Is there any performance test of PHP/MySQL out there I could run on my
>development or deployment machines?
>
>~ Mike
>--
>Mike Zornek | Project Leader
>Apple Student Developers
>The Insanely Great Site with the Insanely Long URL
>http://www.applestudentdevelopers.org
>
>Personal Site:
>http://www.mikezornek.com
>
>
>--
>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] Re: [Q] EXT SQL IN PostgreSQL

2002-06-21 Thread Yasuo Ohgaki

PostgreSQL module does not have cursor.

All you have to do is execute query then
fetch records one by one. For example,


$result = pg_query($db_connection, 'select * from your_table;');

while ($record = pg_fetch_array($result)) {
  print_r($record);
}

Above code can be used to print all records in
a result set.

--
Yasuo Ohgaki

Brown wrote:
> # Sorry to my poor English
> 
> I have a procedure ( named by select_table )
> 
> ##
> BEGIN;
> select select_table('select_cur','table_name');
> FETCH ALL IN select_cur;
> COMMIT;
> ##
> 
> This Query is right In Console (psql).
> 
> I wanna see a result with php.
> 
> $sql = "
> BEGIN;
> select select_table('select_cur','table_name');
> FETCH ALL IN select_cur;
> COMMIT;
> ";
> $result = pg_exec($connect,$sql);
> $row = pg_fetch_row($result);
> 
> is not run.
> 
> How can I get the CURSOR from PostgreSQL with PHP ?
> 
> 
> 
> 
> 
> 
> 
> 
> 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] password()... is it possible?

2002-06-21 Thread César Aracena

Hi all,
 
I need the administrators of one site to actually see the user’s
passwords. I like using password() for encrypting but doesn’t know if it
can be retrieved in common English.
 
Thanks,
 
Cesar Aracena  
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621
 



Re: [PHP-DB] MYSQL Socket error :\

2002-06-21 Thread Marco Lanini

Thanks Dan, but i have already tested this solution...

i have build a very little test script, who generate this error.



i am in localhost and i use very simple "root" "admin" login
but the message is always the same!

Can't create TCP/IP socket (10106)

i think, probably is an error in php.ini configuration, but what error???

thanks to all.


"Dan Harrington" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm no expert on XP, but you may want to check
> the firewall settings, to make sure that windows XP
> isn't preventing the connection.
>
> For the $host, you may want to either use
> 'localhost' or 127.0.0.1
>
> Cheers,
> Dan
>
>
> > -Original Message-
> > From: Marco Lanini [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 21, 2002 11:20 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] MYSQL Socket error :\
> >
> >
> > Hi
> >
> > sorry for my english but i'm italian.
> >
> > I have a server who run with
> >
> > WIN XP HOME
> > Abyss Web Server (Freeware) www.aprelium.com
> > MySql 4.0.1-alpha-nt
> > PHP 4.2.1
> >
> > when i use mysql_connect($host,$user,$pass) or die(mysql_error());
function
> >
> > he write:
> >
> > Can't create TCP/IP socket (10106)
> >
> > i have searched explanations on the internet but unfotunately i haven't
find
> > out nothing.
> >
> > thanks for your help.
> >
> >
> >
> >
> > --
> > 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




RE: [PHP-DB] MYSQL Socket error :\

2002-06-21 Thread Aaron T. Weiker

It may prove beneficial to check the event log. More clues may lie in
there. If the webserver has any type of error log check that as well.

Aaron Weiker

> -Original Message-
> From: Marco Lanini [mailto:[EMAIL PROTECTED]] 
> Sent: Saturday, June 22, 2002 1:10 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] MYSQL Socket error :\
> 
> 
> Thanks Dan, but i have already tested this solution...
> 
> i have build a very little test script, who generate this error.
> 
>  
> mysql_connect("127.0.0.1","root","admin") or 
> die(mysql_error()); print("connected!!!");
> 
> ?>
> 
> i am in localhost and i use very simple "root" "admin" login 
> but the message is always the same!
> 
> Can't create TCP/IP socket (10106)
> 
> i think, probably is an error in php.ini configuration, but 
> what error???
> 
> thanks to all.
> 
> 
> "Dan Harrington" <[EMAIL PROTECTED]> ha scritto nel messaggio 
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I'm no expert on XP, but you may want to check
> > the firewall settings, to make sure that windows XP
> > isn't preventing the connection.
> >
> > For the $host, you may want to either use
> > 'localhost' or 127.0.0.1
> >
> > Cheers,
> > Dan
> >
> >
> > > -Original Message-
> > > From: Marco Lanini [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, June 21, 2002 11:20 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-DB] MYSQL Socket error :\
> > >
> > >
> > > Hi
> > >
> > > sorry for my english but i'm italian.
> > >
> > > I have a server who run with
> > >
> > > WIN XP HOME
> > > Abyss Web Server (Freeware) www.aprelium.com
> > > MySql 4.0.1-alpha-nt
> > > PHP 4.2.1
> > >
> > > when i use mysql_connect($host,$user,$pass) or die(mysql_error());
> function
> > >
> > > he write:
> > >
> > > Can't create TCP/IP socket (10106)
> > >
> > > i have searched explanations on the internet but unfotunately i 
> > > haven't
> find
> > > out nothing.
> > >
> > > thanks for your help.
> > >
> > >
> > >
> > >
> > > --
> > > 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] retrieving all information from a single table

2002-06-21 Thread Jason Wong

On Saturday 22 June 2002 06:27, Jonathan wrote:
> Hello everyone,
> I am brand new to php, so any replies I get are very much appreciated.
> My goal is to retrieve one entire table from my database and post the
> information on the web.  My query seems successful, but I am having trouble
> getting the information out from the variable $result.  

Saying exactly what the trouble is would help!

> My table has 4
> fields, the primary key, "location," "organization," and "charge."   Any
> suggestions?   A million thanks.  Here is the code:
>
> 
> 
> /* Connectiong*/
> @ $db = mysql_connect("localhost", "NAME","PASS");
>
>if (!$db)
> {
>   echo "Error, please try again.";
>   exit;
> }
> /* Selecting database*/
> $db2 = mysql_select_db ("DATABASE");
> if (!$db2)
> {
>   echo "error again";
>   exit;
> }
>  /*sending query */
> $query = "select * from `$mytable` where $i";
> $result = mysql_query($query);
>
> /*testing to see if result has the data */
> if (!$result){echo "result is empty";}
>
> for ($a=0;$a<4;$a++)
> {
>  for($i=0;$i<4;$i++)
> {
>   $row = mysql_fetch_array($result);
> echo $row[i]["organization"]."";
> echo $row[i["location"]."";
>  echo $row[i]["charge"];
>   }
> }

The standard way to retrieve results from a query would be:

while ($row = mysql_fetch_array($result)) {
  echo $row['organization'];
  ...
  ...
}

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"What did you do when the ship sank?"
"I grabbed a cake of soap and washed myself ashore."
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php