[PHP-DB] Problem with passing variables

2004-01-27 Thread Phil Matt
Hello to all. I am a relative newcomer to PHP. I am trying to pass the value of a variable from a MySQL database from one PHP page to another PHP page. On the first page, I've made the connection to the database, and the query works just fine, displaying the correct values from the $myrow

Re: [PHP-DB] Problem with passing variables

2004-01-27 Thread Viorel Dragomir
- Original Message - From: Phil Matt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 17:08 Subject: [PHP-DB] Problem with passing variables Hello to all. I am a relative newcomer to PHP. I am trying to pass the value of a variable from a MySQL database from

Re: [PHP-DB] Problem with passing variables

2004-01-27 Thread Ricardo Lopes
If you have something like this: echo 'tda href=email.php?recip=$myrow[0]img src=graphics/mail.gif class=imglink alt=Click to send mail to this person //a/td/tr'; It wont work. Use instead: echo 'tda href=email.php?recip='.$myrow[0].'img src=graphics/mail.gif class=imglink alt=Click to send

RE: [PHP-DB] Results with ledger stripes?

2004-01-27 Thread Gary Every
Haven't been following this thread, but here's how we do it: If($bgc == '') { $bgc = #DD; } elseif($bgc == #FF) { $bgc = #DD; } else { $bgc = #FF; } Gary Every Sr. UNIX Administrator Ingram Entertainment Inc. 2 Ingram Blvd, La Vergne, TN 37089 Pay It

Re: [PHP-DB] Results with ledger stripes?

2004-01-27 Thread Ricardo Lopes
It isnt pretty, efficient or small, but it works... :) - Original Message - From: Gary Every [EMAIL PROTECTED] To: Ryan Jameson (USA) [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 4:13 PM Subject: RE: [PHP-DB] Results with ledger stripes? Haven't been following

Re: [PHP-DB] Problem with passing variables

2004-01-27 Thread Phil Matt
On 27 Jan 2004 at 15:56, Ricardo Lopes wrote: If you have something like this: echo 'tda href=email.php?recip=$myrow[0]img src=graphics/mail.gif class=imglink alt=Click to send mail to this person //a/td/tr'; It wont work. Use instead: echo 'tda href=email.php?recip='.$myrow[0].'img

Re: [PHP-DB] Problem with passing variables

2004-01-27 Thread Ricardo Lopes
Yes, the sintax is correct (if you are inside an echo or inside a print opened with ' and not with ). ex: echo 'a href=email.php?foo='.$myrow[3].'?recip='.$myrow[0].' ';-- correct echo a href=email.php?foo='.$myrow[3].'?recip='.$myrow[0].' ; --- error !!! (parse error) I know that you must

[PHP-DB] php-db Forms-Radio problems

2004-01-27 Thread Mignon Hunter
Hello I'm having a devil of a time with my form. I'm able to process checkboxes and fields but am having trouble with radio buttons. Here's how I'm doing the fields which works: snippet Your Last Name input type=text name=last value= size=30

Re: [PHP-DB] php-db Forms-Radio problems

2004-01-27 Thread Stuart
Mignon Hunter wrote: input type=radio name=job value=oper Operation Maintenance input type=radio name=job value=eng Engineering (Including Project Management) input type=radio name=job value=mgmt

[PHP-DB] php-db- Forms radion buttons

2004-01-27 Thread Mignon Hunter
Hello I'm having a devil of a time with my form. I'm able to process checkboxes and fields but am having trouble with radio buttons. Here's how I'm doing the fields which works: snippet Your Last Name input type=text name=last value= size=30

Re: [PHP-DB] php-db Forms-Radio problems

2004-01-27 Thread Mignon Hunter
THANK YOU duh me I knew it was something simple :( Mignon Hunter Webmaster Toshiba International Corporation (713) 466-0277 x 3461 (800) 466-0277 x 3461 Stuart [EMAIL PROTECTED] 01/27/04 11:41AM Mignon Hunter wrote: input type=radio name=job value=oper Operation Maintenance

[PHP-DB] php-db globals turned off

2004-01-27 Thread Mignon Hunter
How do most of you handle variables in next page after passing. For instance. What I have right now (very ugly) is: $email = $_POST['emal']; $first = $_POST['first']; $lastl = $_POST['last']; Then I work with $email, $first etc... I will have to do this for many, many variables which doesnt

RE: [PHP-DB] Can anyone see what's wrong with this code?

2004-01-27 Thread Paul Miller
You probably need to specify the path in the filesize call also. It looks like you are just pushing the filename. Like $filepath = /home/www/nortonway/photos/$filename; $fd = fopen($filepath, rb); $filedata = fread ($fd, filesize($filepath)); $zipfile - add_file($filedata, $filename);

RE: [PHP-DB] php-db globals turned off

2004-01-27 Thread Paul Miller
I love this one... extract($_REQUEST); but it undermines the whole reason PHP moved to the new default parameter specification. Be careful with you coding. I use it, and it makes things much like the pre 4.3.2 release without changing the ini files. You just have to specify the default

RE: [PHP-DB] php-db Forms-Radio problems

2004-01-27 Thread Duane Lakoduk
It appears the intention of the text input is to provide an other job type. Instead of removing it, rename it to job_other or something. Then test for the value of job, if other use job_other value. -Original Message- From: Stuart [mailto:[EMAIL PROTECTED] Sent: Tuesday, January

Re: [PHP-DB] MS SQL date time strangeness

2004-01-27 Thread Steve
I tried what you had suggested and I still get the same result. Robert Twitty wrote: The date() is for use with the 32-bit C time value returned by functions like time(). Data from fields of type datetime are returned as strings in the form Jan 9 2004 by the mssql extension as the default. To

[PHP-DB] MySQL charset Error (CLI / CGI)

2004-01-27 Thread Kai Happe
Situation: The Application is written in php 4.3.4 runs on apache 2.0.45 and uses mySQL 4.1.1. All tables in the database are defined with a charset UTF-8. The Application uses the Apache Module and works very well. Now the application must use coding which is not included, we want to call

[PHP-DB] Re: Results with ledger stripes?

2004-01-27 Thread James Hatridge
On Tuesday 27 January 2004 17:13, Ricardo Lopes wrote: It isnt pretty, efficient or small, but it works... :) Try this: $c= (++$ZZ%2? 'yellow':'white'); printf(tr bgcolor=\$c\); - Original Message - From: Gary Every [EMAIL PROTECTED] To: Ryan Jameson (USA) [EMAIL PROTECTED];

Re: [PHP-DB] php-db globals turned off

2004-01-27 Thread John W. Holmes
Mignon Hunter wrote: How do most of you handle variables in next page after passing. For instance. What I have right now (very ugly) is: $email = $_POST['emal']; $first = $_POST['first']; $lastl = $_POST['last']; Why are you recreating variables? You already have a variable $_POST['email'], so

Re: [PHP-DB] MS SQL date time strangeness

2004-01-27 Thread Robert Twitty
Oops Use Off instead of On, or execute this in your script: ini_set('mssql.datetimeconvert' , 0 ); Note: Do not use the date() function to display the value. Just display it asis. -- bob On Tue, 27 Jan 2004, Steve wrote: I tried what you had suggested and I still get the same result.

Re: [PHP-DB] php-db globals turned off

2004-01-27 Thread Mignon Hunter
So it will be easier to use in my script on this page, where I'm creating several query strings with the data. Mignon Hunter Webmaster Toshiba International Corporation (713) 466-0277 x 3461 (800) 466-0277 x 3461 John W. Holmes [EMAIL PROTECTED] 01/28/04 01:15PM Mignon Hunter wrote: How

RE: [PHP-DB] php-db globals turned off

2004-01-27 Thread Paul Miller
Also, many legacy applications use the non $_POST variable definitions. A problem that I ran into. - Paul -Original Message- From: Mignon Hunter [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 1:47 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] php-db

RE: [PHP-DB] php-db globals turned off

2004-01-27 Thread Mignon Hunter
How would you extract variables from arrays? before I was doing $prod[] = $_POST['prod']; $choice[] = $_POST['choice']; then I could iterate through $prod[], $choice[] Mignon Hunter Webmaster Toshiba International Corporation (713) 466-0277 x 3461 (800) 466-0277 x 3461 Paul Miller [EMAIL

[PHP-DB] Oracle and upper case field name

2004-01-27 Thread William Cheung
Hi, When Oracle returns the result set, the field names are all in upper case. However, I have an application that needs to work on both MSSQL and Oracle. I dont want to keep 2 copies. One has upper case field names and the other lower case. How could I make PHP or ADODB to work with

RE: [PHP-DB] php-db globals turned off

2004-01-27 Thread Paul Miller
I am not 100% sure what you are doing here, so I am responding with this... if (is_array($_POST['prod']) { // Value is an Array $prod = $_POST['prod']; }else{ // Value is not an array, but the value // is added to the first element. $prod[] =

RE: [PHP-DB] Oracle and upper case field name

2004-01-27 Thread Paul Miller
the way I do it is with http://www.ytztech.com product SQL_AL.PHP which has a switch that will say all values are upper or lower. You can also create a simple wrapper function that will do the lower conversion. - Paul -Original Message- From: William Cheung [mailto:[EMAIL PROTECTED]

Re: [PHP-DB] php-db globals turned off

2004-01-27 Thread John W. Holmes
Paul Miller wrote: Also, many legacy applications use the non $_POST variable definitions. A problem that I ran into. So how is saying $email = $_POST['email'] going to help you in that case?? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The

Re: [PHP-DB] php-db globals turned off

2004-01-27 Thread John W. Holmes
Mignon Hunter wrote: So it will be easier to use in my script on this page, where I'm creating several query strings with the data. I understand it's easier to type $email vs. $_POST['email'] at first, but not once you get used to it. Both are variables that can be used in the same exact way,

Re: [PHP-DB] php-db globals turned off

2004-01-27 Thread Stuart
Mignon Hunter wrote: How do most of you handle variables in next page after passing. For instance. What I have right now (very ugly) is: $email = $_POST['emal']; $first = $_POST['first']; $lastl = $_POST['last']; Then I work with $email, $first etc... I will have to do this for many, many

RE: [PHP-DB] php-db globals turned off

2004-01-27 Thread Paul Miller
As mentioned in my first email, PHP and myself think turning the global var reg off is a good thing, especially for inexperienced coders and var definition. $email = $_POST['email'] makes a difference is you are dealing with an application that was built during the 90% of PHP's lifetime where reg

Re: [PHP-DB] Oracle and upper case field name

2004-01-27 Thread Daniel Clark
I might try having a common PHP function that converts all field names to lower case, and call that function with every field name. Or call each field by column number, $row[1] . When Oracle returns the result set, the field names are all in upper case. However, I have an application that

Re: [PHP-DB] Oracle and upper case field name

2004-01-27 Thread John W. Holmes
From: Daniel Clark [EMAIL PROTECTED] I might try having a common PHP function that converts all field names to lower case, and call that function with every field name. Or call each field by column number, $row[1] . Like http://us2.php.net/manual/en/function.array-change-key-case.php ??

Re: [PHP-DB] Oracle and upper case field name

2004-01-27 Thread Daniel Clark
Yeah, Looks good to me :-) Like http://us2.php.net/manual/en/function.array-change-key-case.php ?? When Oracle returns the result set, the field names are all in upper case. However, I have an application that needs to work on both MSSQL and Oracle. I don?t want to keep 2 copies. One has

[PHP-DB] MS SQL Server Question

2004-01-27 Thread Ryan Jameson (USA)
This doesn't have anything to do with PHP, but it does have to do with MS SQL server and I know we've got a buncha smart folks on this list. I'm sure you'll forgive the slightly OT post. I have a stored procedure that I want to protect from external rollback calls. Basically, it logs calls to

[PHP-DB] TIME CALCULATION IN PHP

2004-01-27 Thread Delz
Hi All, How do i calculate time in PHP lets say I have this example Input Time Started : 9:00 Input Time Ended : 13:00 Answer Total Time in Hours : 4 Total Time in Minutes : 240 Any help will be appreciated. Thanks Delz -- PHP Database Mailing List (http://www.php.net/) To unsubscribe,