[PHP] How do I do this select?

2004-01-11 Thread Chris W
I sent this to the mysql list but it doesn't seem to be working so I was hoping someone here could help. I have the following 2 tables. CREATE TABLE User ( UserKey INT NOT NULL AUTO_INCREMENT, UserIDCHAR(16) NOT NULL UNIQUE , Name VARCHAR(20), PRIMARY KEY (UserKey) ); CREATE T

Re: [PHP] How do I do this PERL in PHP?

2003-09-17 Thread Don Read
On 16-Sep-2003 Susan Ator wrote: > I have a text file with the following format: > > name > stuff > > message text > message text > message text > If you're sure the format is exactly that, then ... $pat=array( '', '', ); $marker=''; $data=file_get_contents('dafile.txt'); $msgblks=

RE: [PHP] How do I do this PERL in PHP?

2003-09-16 Thread SLanger
hello just a side note instead of > ereg( '^<$var>(.*)$', $line, $matches ) use preg_match('/^<'.$var.'>(.*)$/', $line, $matches) since it is faster than ereg. Regards Stefan Langer

RE: [PHP] How do I do this PERL in PHP?

2003-09-16 Thread Susan Ator
Thank y'all so much for all your help. sa -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 2:30 PM To: Susan Ator Cc: [EMAIL PROTECTED] Subject: RE: [PHP] How do I do this PERL in PHP? The following will do variable matching lik

RE: [PHP] How do I do this PERL in PHP?

2003-09-16 Thread Robert Cummings
he same thing over and over if > there is a way to avoid it. :) > > sa > > > -Original Message- > From: Robert Cummings [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 16, 2003 12:05 PM > To: Susan At

RE: [PHP] How do I do this PERL in PHP?

2003-09-16 Thread Chris Shiflett
--- Susan Ator <[EMAIL PROTECTED]> wrote: > It works beautifully. My only question is there a way to pass a > variable to the ereg? In other words: > > if( ereg( '^(.*)$', $line, $matches ) ) > > would become: > > if( ereg( '^<$var>(.*)$', $line, $matches ) ) > > I've tried doing eval b

RE: [PHP] How do I do this PERL in PHP?

2003-09-16 Thread Susan Ator
lot of fields and I hate doing the same thing over and over if there is a way to avoid it. :) sa -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 12:05 PM To: Susan Ator Cc: [EMAIL PROTECTED] Subject: Re: [PHP] How do I do this PERL i

Re: [PHP] How do I do this PERL in PHP?

2003-09-16 Thread Robert Cummings
This isn't tested, but should work :) // $to = ''; $subject = ''; $message = ''; $matches = array(); $data = file( $file ); foreach( $data as $id => $line ) { if( ereg( '^(.*)$', $line, $matches ) ) { $to = trim( $matches[1] );

[PHP] How do I do this PERL in PHP?

2003-09-16 Thread Susan Ator
I have a text file with the following format: name stuff message text message text message text I need to be able to assign a variable to the data like so: $to = "everything to the left of "; $subject = "everything to the left of "; $message = "everything to the left of "; so $to = "name";

[PHP] How do I do this

2001-12-13 Thread Boget, Chris
I've got the following possible (example) strings: [hi] there, this is me [HI] there, this is me [ho] there, that is you [HO] there, that is you [hey] there, where are you [HEY] there, where are you and so on. I'm trying to come up with a regex that will find the capitalized text (only) between

Re: [PHP] how do I do this

2001-04-24 Thread Adrian D'Costa
get the webbrowser > > > to switch the cities in the city-dropdown w/o reloading you'll need to > > > use javascript or similar evil measures... > > > > I want to do it in pure php, how do I do this. > > > > I tried it in javascripts but I could

Re: [PHP] how do I do this

2001-04-23 Thread Philip Olson
rom the dropdownbox, to get the webbrowser > > to switch the cities in the city-dropdown w/o reloading you'll need to > > use javascript or similar evil measures... > > I want to do it in pure php, how do I do this. > > I tried it in javascripts but I could

Re: [PHP] how do I do this

2001-04-23 Thread Adrian D'Costa
his with pure php you'll need to reload the page after > the user selects the country from the dropdownbox, to get the webbrowser > to switch the cities in the city-dropdown w/o reloading you'll need to > use javascript or similar evil measures... I want to do it in pure php, how

Re: [PHP] how do I do this

2001-04-23 Thread Andreas Landmark
On Mon, Apr 23, 2001 at 04:59:49PM +0530, Adrian D'Costa produced this golden nugget: > Hi, > > I have the following script. What I want is that when I select the > country the corresponding cities should only be listed in the second > dropdown box. Can some one guide me. Right below is my tab

[PHP] how do I do this

2001-04-23 Thread Adrian D'Costa
Hi, I have the following script. What I want is that when I select the country the corresponding cities should only be listed in the second dropdown box. Can some one guide me. Right below is my table structure. $searchStmt = "select name from airlines group by name order by name" ; #$searc

Re: [PHP] how do I do this, please?

2001-01-18 Thread John Hinsley
Thanks Richard: I finally got it. I'm *really* rusty 'cos I went completely code blind and struggled for a day with a silly syntax error! This works just fine: http://localhost/calculate_form.html"); exit; } if ($calc == "add") { $result = $val1 + $val2; } else if ($calc == "su

Re: [PHP] how do I do this, please?

2001-01-15 Thread Richard Lynch
> if (ereg !=("^[0-9]+[.]?[0-9]*$", $val1)) { > header("Location:http://localhost/calculate_form.html"); > exit; > > But the script will attempt to perform calculations on non numeric > fields and > > I also want it to return the form if anyone puts in a non numeric value. > > I t

[PHP] how do I do this, please?

2001-01-15 Thread John Hinsley
Can anyone show me how to do this? I'm using a script out of Julie C. Meloni's book: http://localhost/calculate_form.html"); exit; if (ereg !=("^[0-9]+[.]?[0-9]*$", $val2)) { header("Location:http://localhost/calculate_form.html");