[PHP-DB] Re: Converting values from text to numerical
yes you can switch the type of var for examle with: $number = (integer)$textvar; But if you do store it as a textfield you want be able to do some special sql stuff directly in mysql. For example if you store the date as text in the db you want be able to filter out entries which are between x and y. Good luck, Andy -- http://www.globosapiens.net Global Travellers Network! Matthew Nock [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am about to build a database of products that will store features fore ach product in a separate table. I need to be able to store both text and numeric values in this table, but be able to perform mathmatical functions on the numeric variables. is it possible to have PHP covert numbers that are stored as text strings back into values it can calculate with? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: Converting values from text to numerical
Hi All, upon looking at the link Russ gave me earlier... the PHP site recommends the use of is_numeric() function. This does exactly what I want.. there will only be numbers of text in the field. I can quickly run this returned result from the record through this function.. and if it is numeric, then I do one thing (the calc), if its just text, I just echo it to screen. I will be keeping any dates etc in separate fields. So, the is_numeric() does what i need :) Thanks everyone :) -Original Message- From: Andy [mailto:[EMAIL PROTECTED]] Sent: Friday, 21 June 2002 4:22 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: Converting values from text to numerical yes you can switch the type of var for examle with: $number = (integer)$textvar; But if you do store it as a textfield you want be able to do some special sql stuff directly in mysql. For example if you store the date as text in the db you want be able to filter out entries which are between x and y. Good luck, Andy -- http://www.globosapiens.net Global Travellers Network! Matthew Nock [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am about to build a database of products that will store features fore ach product in a separate table. I need to be able to store both text and numeric values in this table, but be able to perform mathmatical functions on the numeric variables. is it possible to have PHP covert numbers that are stored as text strings back into values it can calculate with? -- 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.
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] a back include script
Hello, 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 should have the same function as the back the button of the navigator, somebody has an idea of the script???. Thank you in advance. Sorry for my english! Walid -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] intercative selection menu
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. TRTDB?php echo(cell name)?:/B/TD TDselect name=cellname option value=1904 selected 1904/option option value=1905 1905/option option value=1906 1906/option option value=1907 1907/option option value=1908 1908/option option value=1909 1909/option option value=1910 1910/option option value=1911 1911/option option value=1916 1916/option option value=volta volta/option option value=scatt11 scatt11/option /select /TD/TR -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ARRAY, IF INSERT
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 members sons daughters. I want to display a table with text inserts into the admin can type lets 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 lets say the name field was filled out in order to spend the necessary tables rows. Another thing the Array should also specify new levelIDs for each kid from 1 to 5. It would be great if you also show me how to deal with it after its created. Thanks a lot and sorry for so many questions, Cesar Aracena mailto:[EMAIL PROTECTED] CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621
[PHP-DB] 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 members sons daughters. I want to display a table with text inserts into the admin can type lets 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 lets say the name field was filled out in order to spend the necessary tables rows. Another thing the Array should also specify new levelIDs for each kid from 1 to 5. It would be great if you also show me how to deal with it after its 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:
- 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 Fabiana Fabiano Fatima*** Fernanda * Fernando Francine Fabia Fabio Flavia Franco Freeda Gabriel** George Gaspar Glaucia** Gilberto* Gina Gisela Gisele Gislene Gracielle Graziela Gabriela Giovanna Gracinda Guilherme* Haidy Harold Hannah Harry Hattie Heather* Helena*** Heloisa* Henrique Hilary Hilda* Holly* Houston Ieda Ione Irani Ivani Isabel* * * ** Ines* Inez * Isabela Isaura* Iveruska Jacob Jaclyn Jake Jaqueline Jade James Jamie* Janaina Jane** Janir Jason Jenna Jennifer*** Jenny* Jeannie** Jessica** Jill Joanna Joao ** Jocelyn Joel Joelle Jsia Jolleen
[PHP-DB] WebSite Submissions Question
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
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
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): ?php ### HAHAHA I HATE GOOGLE!!! THEY SUCK!!! ### ### HAHAHA I LAUGH AT THEM, THOSE IDIOTS ### ? !DOCTYPE... Then it will come up like so, when Google/Yahoo/Whoever goes to view it for inspection: !DOCTYPE... htmlblahblah. 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.
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
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
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.
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.
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?
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 have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space;
[PHP-DB] Re: intercative selection menu
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 TRTDB?php echo(cell name)?:/B/TD TDselect name=cellname ?php //Do some database stuff (connect, query, get result etc etc) to get the value that is stored. Put the number into the variable $var for ($i=1904;$i1912;$i++) { printf(option value='%s',$i); if ($var == $i) printf( selected); printf( %s/option,$i); } printf(option value='1916'); if ($var == '1916') printf( selected); printf( 1916/option); printf(option value='volta'); if ($var == 'volta') printf( selected); printf( volta/option); printf(option value='scatt11'); if ($var == 'scatt11') printf( selected); printf( scatt11/option); ? /select /TD/TR 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. TRTDB?php echo(cell name)?:/B/TD TDselect name=cellname option value=1904 selected 1904/option option value=1905 1905/option option value=1906 1906/option option value=1907 1907/option option value=1908 1908/option option value=1909 1909/option option value=1910 1910/option option value=1911 1911/option option value=1916 1916/option option value=volta volta/option option value=scatt11 scatt11/option /select /TD/TR -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Innodb and transactions.
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
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'? ul ? $query = SELECT * FROM `BOARDITEMS` WHERE BOARDID=$BOARDID ORDER BY 'DATETIMEADDED';; $resultboarditems = mysql_query ($query) or die(Invalid Result Set); while ($row = mysql_fetch_array ($resultboarditems)) { ? li? echo $row[DATETIMEADDED]; ?? echo $row[NAME]; ?/li ? } ? /ul 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
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. select name=category_list_array[] multiple size=10 ? for ($i=0; $icount($category_list); $i++) { ? option value=?=$category_list[$i]??=$category_list[$i]?/option ?}? /select 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 option value... 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
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'? ul ? $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)) { ? li? echo $row[DATETIMEADDED]; ?? echo $row[NAME]; ?/li 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
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?
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
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
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?
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
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 'OPTION VALUE=' . $row['category'] . '' . $row['category']; } echo '/select'; while ($row = mysql_fetch_array($result)) { $id = $row['id']; $category = $row['category']; $category_list .= $category; } ? select name=category_list_array[] multiple size=10 ? for ($i=0; $icount($category_list); $i++) { ? option value=?=$category_list[$i]??=$category_list[$i]?/option ?}? /select 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
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 'OPTION VALUE=' . $row['category'] . '' . $row['category']; } echo '/select'; while ($row = mysql_fetch_array($result)) { $id = $row['id']; $category = $row['category']; $category_list .= $category; } ? select name=category_list_array[] multiple size=10 ? for ($i=0; $icount($category_list); $i++) { ? option value=?=$category_list[$i]??=$category_list[$i]?/option ?}? /select 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
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 'OPTION VALUE=' . $row['category'] . '' . $row['category']; } echo '/select'; while ($row = mysql_fetch_array($result)) { $id = $row['id']; $category = $row['category']; $category_list .= $category; } ? select name=category_list_array[] multiple size=10 ? for ($i=0; $icount($category_list); $i++) { ? option value=?=$category_list[$i]??=$category_list[$i]?/option ?}? /select 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.
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
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 select name=\name here\\n; while ($row = mysql_fetch_array($result)) { $id = $row['id']; $category = $row['category']; echo option value=\$category\$category/option\n; } echo /select\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 'OPTION VALUE=' . $row['category'] . '' . $row['category']; } echo '/select'; while ($row = mysql_fetch_array($result)) { $id = $row['id']; $category = $row['category']; $category_list .= $category; } ? select name=category_list_array[] multiple size=10 ? for ($i=0; $icount($category_list); $i++) { ? option value=?=$category_list[$i]??=$category_list[$i]?/option ?}? /select 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 :\
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 :\
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
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($numbersBR); } 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
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
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
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
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
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
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 members sons daughters. I want to display a table with text inserts into the admin can type lets 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 lets say the name field was filled out in order to spend the necessary tables rows. Another thing the Array should also specify new levelIDs for each kid from 1 to 5. It would be great if you also show me how to deal with it after its 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
Re: [PHP-DB] BBS program
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
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 html head Inventory Lookup meta name=GENERATOR content=W3e 2000 title/title /head body ?php $partnum=; function get_partnum($partnum=) { ? FORM ACTION=default.php METHOD=get PartNum:INPUT TYPE=TEXT NAME=partnum INPUT TYPE=submit VALUE=submit /FORM ?php } $dsn=invfile; $user= ; $upasswd= ; get_partnum(); #$partnum= $_get['partnum']; echo $partnum; $conn = odbc_connect($dsn,$user ,$upasswd, SQL_CUR_USE_ODBC ); echo conn: $conn; if ($conn = 0) { echo Error in connectionBR; exit; } else { echo PConnection successful\n; }; $query = SELECT whs,loc,miprod,mndesc,onhand FROM npshrlib_prdinv1 where miprod = '$partnum' ; $result = odbc_exec($conn, $query); odbc_result_all($result); ? /body /html -- 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
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 html head Inventory Lookup meta name=GENERATOR content=W3e 2000 title/title /head body ?php $partnum=; function get_partnum($partnum=) { ? FORM ACTION=default.php METHOD=get PartNum:INPUT TYPE=TEXT NAME=partnum INPUT TYPE=submit VALUE=submit /FORM ?php } $dsn=invfile; $user= ; $upasswd= ; get_partnum(); #$partnum= $_get['partnum']; echo $partnum; $conn = odbc_connect($dsn,$user ,$upasswd, SQL_CUR_USE_ODBC ); echo conn: $conn; if ($conn = 0) { echo Error in connectionBR; exit; } else { echo PConnection successful\n; }; $query = SELECT whs,loc,miprod,mndesc,onhand FROM npshrlib_prdinv1 where miprod = '$partnum' ; $result = odbc_exec($conn, $query); odbc_result_all($result); ? /body /html -- 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] retrieving all information from a single table
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: html body ? /* 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;$a4;$a++) { for($i=0;$i4;$i++) { $row = mysql_fetch_array($result); echo $row[i][organization].br; echo $row[i[location].br; echo $row[i][charge]; } } ? /body /html -- Jonathan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Emulating HTTP File Uploads
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
# 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
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
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
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
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
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?
Hi all, I need the administrators of one site to actually see the users passwords. I like using password() for encrypting but doesnt know if it can be retrieved in common English. Thanks, Cesar Aracena mailto:[EMAIL PROTECTED] CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621
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. ?php 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
RE: [PHP-DB] MYSQL Socket error :\
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. ?php 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