Re: [PHP] OR statement

2005-03-24 Thread Joe Wollard
This can also be done with double pipes, which is what is used in many other languages. - if($audio==Cool || $audio==junk || $audio==Funky){ Do this } else{ Do this } -- As far as I can tell there are no plans to remove or reason to

Re: [PHP] SQL statement - date

2005-03-23 Thread Jesper Goos
take a look here http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html the first example should help you... regards jesper Jacques wrote: How should I formulate my sql statement to create a result set of members who registered between now and 7 days ago? I have tried the following

Re: [PHP] and statement

2004-11-28 Thread John Nichel
Brad Ciszewski wrote: is there an 'and' statement for mysql, when you are doing multiple wheres? Is there a PHP question in your MySQL question? -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] sql statement help needed

2004-06-30 Thread Binay
- Original Message - From: Chris W. Parker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 01, 2004 3:33 AM Subject: [PHP] sql statement help needed hello, i've had to change some of my tables to accomodate some greater flexibility in the application that uses it and

Re: [PHP] nested statement problem

2004-06-11 Thread Curt Zirzow
* Thus wrote Eric Boerner ([EMAIL PROTECTED]): I am having a problem with a nested if statement in php. Everything works fine, but it doesn't display the information that I am trying to retrieve using a second if statement. CODE: if (($fr == 'FR') ($xe == 'XE') ($co == 'CO')) { print

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] Is it possible to request that a string CONTAINS another string...? EG: $string = 1, 2, 3, 7, 8, 9; if ($string CONTAINS 7) { // Do stuff } [/snip] Almost any regex function would work here, for instance $string = 1, 2, 3, 7, 8, 9; if (preg_match(/7/, $string)){ //evaluates to

Re: [PHP] IF statement question...

2004-05-19 Thread Oliver Hankeln
[EMAIL PROTECTED] wrote: Is it possible to request that a string CONTAINS another string...? EG: $string = 1, 2, 3, 7, 8, 9; if ($string CONTAINS 7) { // Do stuff } int strpos ( string haystack, string needle [, int offset]) is what you are looking for. HTH, Oliver Hankeln -- PHP General

RE: [PHP] IF statement question...

2004-05-19 Thread Ford, Mike [LSS]
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 19 May 2004 12:55 Is it possible to request that a string CONTAINS another string...? EG: $string = 1, 2, 3, 7, 8, 9; if ($string CONTAINS 7) { // Do stuff } if (strpos($string,

Re: [PHP] IF statement question...

2004-05-19 Thread Oliver Hankeln
Jay Blanchard wrote: [snip] Is it possible to request that a string CONTAINS another string...? EG: $string = 1, 2, 3, 7, 8, 9; if ($string CONTAINS 7) { // Do stuff } [/snip] Almost any regex function would work here, for instance $string = 1, 2, 3, 7, 8, 9; if (preg_match(/7/, $string)){

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] Tipp: Do not use preg_match() if you only want to check if one string is contained in another string. Use strpos() or strstr() instead as they will be faster. [/snip] This brings up a good point. Just exactly how much faster would one be over another in this small example? How big

Re: [PHP] IF statement question...

2004-05-19 Thread Oliver Hankeln
Jay Blanchard wrote: [snip] Tipp: Do not use preg_match() if you only want to check if one string is contained in another string. Use strpos() or strstr() instead as they will be faster. [/snip] This brings up a good point. Just exactly how much faster would one be over another in this small

Re: [PHP] IF statement question...

2004-05-19 Thread Curt Zirzow
* Thus wrote Oliver Hankeln ([EMAIL PROTECTED]): Jay Blanchard wrote: [snip] Tipp: Do not use preg_match() if you only want to check if one string is contained in another string. Use strpos() or strstr() instead as they will be faster. [/snip] This brings up a good point. Just

Re: [PHP] IF statement question...

2004-05-19 Thread Oliver Hankeln
Curt Zirzow wrote: * Thus wrote Oliver Hankeln ([EMAIL PROTECTED]): 10 Searches in a rather small string took 0.38s with strpos() and 0.55s with preg_match() Make sure your benchmarks aren't bias: - assignment takes time - concating string takes time You are right. I updated the script

Re: [PHP] IF statement question...

2004-05-19 Thread Tristan . Pretty
not returning a false value... But I'm still not getting the correct output on my page... Any other ideas? Oliver Hankeln [EMAIL PROTECTED] 19/05/2004 15:49 To [EMAIL PROTECTED] cc Subject Re: [PHP] IF statement question... Curt Zirzow wrote: * Thus wrote Oliver Hankeln ([EMAIL PROTECTED

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] If I'm being Dumb, I apologies... but When using this: $row[bands] = 1,2,3,4,5,6,7,8; $row2[id] = 7; if (strpos($row[bands], $row2[id]) != FALSE) { // do stuff } [/snip] What is the expected output? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] IF statement question...

2004-05-19 Thread John Nichel
Curt Zirzow wrote: Make sure your benchmarks aren't bias: - assignment takes time - concating string takes time strpos($haystack,$needle); v.s. preg_match($regex,$haystack); Just for shits and giggles (and because it's a slow work day), the below script output this... strpos() :

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] strpos() : 0.18918436765671 preg_match() : 0.26665662288666 [/snip] 1/3rd of a second slowerinteresting. You know what though, my original assertion is correctalmost any of the regex functions will work. Tristan, why not convert the string to an array and then use in_array()?

RE: [PHP] IF statement question...

2004-05-19 Thread Ford, Mike [LSS]
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 19 May 2004 15:47 If I'm being Dumb, I apologies... but When using this: $row[bands] = 1,2,3,4,5,6,7,8; $row2[id] = 7; if (strpos($row[bands], $row2[id]) != FALSE) { // do stuff } I get

RE: [PHP] IF statement question...

2004-05-19 Thread Michael Sims
Jay Blanchard wrote: [snip] strpos() : 0.18918436765671 preg_match() : 0.26665662288666 [/snip] 1/3rd of a second slowerinteresting. You know what though, my original assertion is correctalmost any of the regex functions will work. Personally, I prefer using preg_match() 9 times

Re: [PHP] IF statement question...

2004-05-19 Thread John Nichel
Jay Blanchard wrote: [snip] strpos() : 0.18918436765671 preg_match() : 0.26665662288666 [/snip] 1/3rd of a second slowerinteresting. You know what though, my original assertion is correctalmost any of the regex functions will work. Tristan, why not convert the string to an array and then

Re: [PHP] IF statement question...

2004-05-19 Thread John Nichel
John Nichel wrote: Jay Blanchard wrote: [snip] strpos() : 0.18918436765671 preg_match() : 0.26665662288666 [/snip] 1/3rd of a second slowerinteresting. You know what though, my original assertion is correctalmost any of the regex functions will work. Tristan, why not convert the string to

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] strpos() : 0.19018315076828 preg_match() : 0.26157474517822 in_array() : 0.26403407096863 [/snip] Very interesting...thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] IF statement question...

2004-05-19 Thread Curt Zirzow
* Thus wrote Jay Blanchard ([EMAIL PROTECTED]): [snip] strpos() : 0.19018315076828 preg_match() : 0.26157474517822 in_array() : 0.26403407096863 [/snip] Very interesting...thanks! So if we're not going to search though a string 10,000 times you'll save ~0.07139159440994 seconds. or

RE: [PHP] for statement weirdness, no echo SOLVED

2003-12-09 Thread Jay Blanchard
[snip] for($i = 2; $i 0144; $i++){ echo $i . \n; } does not echo anything. Even put the numbers in quotes (single and double). What has being brain-dead caused me to miss this morning? [/snip] I found it...one too many zeros in initial $i (I wanted to say one two many..) :)

Re: [PHP] for statement weirdness, no echo

2003-12-09 Thread Richard Davey
Hello Jay, Tuesday, December 9, 2003, 1:31:35 PM, you wrote: JB for($i = 2; $i 0144; $i++){ JB echo $i . \n; JB } JB does not echo anything. Even put the numbers in quotes (single and JB double). What has being brain-dead caused me to miss this morning? Look at your values

Re: [PHP] if statement

2003-09-30 Thread Brad Pauly
Steve Buehler wrote: [snip] $array=(/etc/bind/options.conf.wp,/etc/bind/rndc.conf.wp,/etc/bind/keys.conf.wp); if($k2b==$array){ do this1 }else{ do this2 } You are close. Check out in_array(). http://us4.php.net/in_array if (in_array($kb2, $array)) - Brad -- PHP General Mailing List

Re: [PHP] if statement

2003-09-30 Thread Marek Kilimajer
if(in_array($k2b, $array)) { ... Steve Buehler wrote: I have an if statement that I would like to make a little bit more generic. This is how the statement looks now. if($k2b==/etc/bind/options.conf.wp || $k2b==/etc/bind/rndc.conf.wp || $k2b==/etc/bind/keys.conf.wp){ do this1 }else{

Re: [PHP] if statement

2003-09-30 Thread Curt Zirzow
* Thus wrote Steve Buehler ([EMAIL PROTECTED]): What I would like to do is to have an array earlier in the script of just the items that it is checking for so that it can be more easily changed if I put this out as free or shareware software. Here is what it might look like, but I know

Re: [PHP] if statement

2003-09-30 Thread Steve Buehler
To Brad, Marek and Curt (and anybody who responds after this) Thank you so much for your help. This is going to help me out so much in a lot of my scripts. It will sure make them a little.Noa LOT more portable now. Thanks Steve At 11:26 AM 9/30/2003, you wrote: Steve Buehler

Re: [PHP] SQL statement

2003-09-28 Thread sfdgfg
Curt Zirzow wrote: * Thus wrote Dan J. Rychlik ([EMAIL PROTECTED]): Well, we have a word for myself that over looks things and takes things literal. Its called pencil smoke It means dump, dunce, and lost. Jennifer was right, their was an error in my SQL query. technically it was an error in

RE: [PHP] SQL statement

2003-09-23 Thread Chris W. Parker
Dan J. Rychlik mailto:[EMAIL PROTECTED] on Tuesday, September 23, 2003 4:58 PM said: I know its failing because php doesnt like the quotation before the format parameters. Ive tried to fix this without any luck. Any Ideas ? It's failing because the ' before the %d is closing the

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
, September 23, 2003 7:07 PM Subject: RE: [PHP] SQL statement Dan J. Rychlik mailto:[EMAIL PROTECTED] on Tuesday, September 23, 2003 4:58 PM said: I know its failing because php doesnt like the quotation before the format parameters. Ive tried to fix this without any luck. Any Ideas

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
Ive used this $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); But I recieve unknown index timestamp. *shrug* You are receiving the error on an array returned by fetch_array? If so, it is because the index is DATE_FORMAT(timestamp, '%d%m%y'), not

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:15 PM Subject: RE: [PHP] SQL statement Ive used this $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); But I recieve unknown index timestamp

RE: [PHP] SQL statement

2003-09-23 Thread Cody Phanekham
= SELECT username, password, DATE_FORMAT(NOW(), '%d%m%y') FROM custlogon; -Original Message- From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] Sent: Wednesday, 24 September 2003 10:10 To: Chris W. Parker; [EMAIL PROTECTED] Subject: Re: [PHP] SQL statement Ive used this $query

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
Jennifer, you're right, I am using fetch_array... I tried to use your suggestion, and it failing as well, It wont even execute Do you have a better method of looping through all these records?? There's probably an error in my SQL syntax. What is mysql_error() telling you? If it was my

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
try this: $query = SELECT username, password, DATE_FORMAT(CURRENT_TIMESTAMP(), '%d%m%y') FROM custlogon; or if that doesnt work try: $query = SELECT username, password, DATE_FORMAT(NOW(), '%d%m%y') FROM custlogon; [snip] original query as posted: SELECT username, password,

Re: [PHP] SQL statement

2003-09-23 Thread Raquel Rice
On Tue, 23 Sep 2003 19:10:29 -0500 Dan J. Rychlik [EMAIL PROTECTED] wrote: Ive used this $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); But I recieve unknown index timestamp. *shrug* Is timestamp an actual columnname in your table? -- Raquel

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
] Sent: Tuesday, September 23, 2003 7:25 PM Subject: RE: [PHP] SQL statement Jennifer, you're right, I am using fetch_array... I tried to use your suggestion, and it failing as well, It wont even execute Do you have a better method of looping through all these records?? There's

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
[EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:15 PM Subject: RE: [PHP] SQL statement Ive used this $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); But I recieve unknown index timestamp. *shrug* You are receiving

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
Jennifer, you're right, I am using fetch_array... I tried to use your suggestion, and it failing as well, It wont even execute There's probably an error in my SQL syntax. What is mysql_error() telling you? I dont believe it to be an error because Ive run this from the CLI

RE: [PHP] SQL statement

2003-09-23 Thread Cody Phanekham
to something else and see if that helps? -Original Message- From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] Sent: Wednesday, 24 September 2003 10:32 To: [EMAIL PROTECTED]; Chris W. Parker; [EMAIL PROTECTED] Subject: Re: [PHP] SQL statement This didnt work as well. SELECT username

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
\Apache Group\Apache2\htdocs\Ameriforms\admintool\includes\getlogonhist.php on line 44 - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:39 PM Subject: RE: [PHP] SQL statement Jennifer

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
http://www.mysql.com/doc/en/Reserved_words.html [snip] 6.1.7 Is MySQL Picky About Reserved Words? A common problem stems from trying to create a table with column names that use the names of datatypes or functions built into MySQL, such as TIMESTAMP or GROUP. You're allowed to do it (for

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
timestamp to something else and see if that helps? -Original Message- From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] Sent: Wednesday, 24 September 2003 10:32 To: [EMAIL PROTECTED]; Chris W. Parker; [EMAIL PROTECTED] Subject: Re: [PHP] SQL statement This didnt work as well

RE: [PHP] SQL statement

2003-09-23 Thread Javier Muniz
You need to change timestamp to formatted_ts in your php code. -Original Message- From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 5:45 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] SQL statement Thank you for your time on this. I do

RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
Thank you for your time on this. No problem. ?php // Function that runs reports on logon history function logonHist() { db_connect(); //establish connection $_qlogonhist = (SELECT username,host_info,status, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts FROM

Re: [PHP] SQL statement

2003-09-23 Thread Dan J. Rychlik
, September 23, 2003 7:50 PM Subject: Re: [PHP] SQL statement I tried this, and it failed. Thank you for the suggestion! - Original Message - From: Cody Phanekham [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL

Re: [PHP] SQL statement

2003-09-23 Thread Curt Zirzow
* Thus wrote Jennifer Goodie ([EMAIL PROTECTED]): http://www.mysql.com/doc/en/Reserved_words.html [snip] 6.1.7 Is MySQL Picky About Reserved Words? A common problem stems from trying to create a table with column names that use the names of datatypes or functions built into MySQL,

Re: [PHP] SQL statement

2003-09-23 Thread Curt Zirzow
* Thus wrote Dan J. Rychlik ([EMAIL PROTECTED]): Well, we have a word for myself that over looks things and takes things literal. Its called pencil smoke It means dump, dunce, and lost. Jennifer was right, their was an error in my SQL query. technically it was an error in the code not the

[PHP] Re: php path statement appears on my webpages

2003-07-31 Thread Ivo Fokkema
If you don't run PHP as an CGI but as an module, you don't even need this line. My guess is that you run PHP as a module, so delete the line to fix your problem. HTH, -- Ivo Fokkema PHP MySQL programmer Leiden University Medical Centre Netherlands Jim M Gronquist [EMAIL PROTECTED] wrote in

RE: [PHP] Re: php path statement appears on my webpages

2003-07-31 Thread Gronquist, Jim M
Ivo, Thanks, but if I leave off this line then I get an error when I try and view my pages. Jim -Original Message- From: Ivo Fokkema [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2003 9:51 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: php path statement appears on my webpages

Re: [PHP] Re: php path statement appears on my webpages

2003-07-31 Thread CPT John W. Holmes
Thanks, but if I leave off this line then I get an error when I try and view my pages. What kind of error, exactly? You need to determine if you're running PHP as a module or CGI. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re: php path statement appears on my webpages

2003-07-31 Thread John Manko
: [PHP] Re: php path statement appears on my webpages If you don't run PHP as an CGI but as an module, you don't even need this line. My guess is that you run PHP as a module, so delete the line to fix your problem. HTH, -- Ivo Fokkema PHP MySQL programmer Leiden University Medical Centre

Re: [PHP] include statement giving me hives! - help

2003-07-17 Thread Marek Kilimajer
DougD wrote: I am new to all this, but here is the basic code: $link_titles = file('links/master.txt'); $links_include = $link_titles[$point]; // path to directory include $links_include; If I echo the value of $links_include just prior to the include() function it contains what I would

Re: [PHP] include statement giving me hives! - SOLVED

2003-07-17 Thread DougD
rtrim () solved the issue. There was a newline sitting at the end of the variable and messing it up! Thanks for all your help! Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] DougD wrote: I am new to all this, but here is the basic code: $link_titles =

Re: [PHP] foreach statement

2003-03-25 Thread Richard Whitney
Get rid of the error Quoting shaun [EMAIL PROTECTED]: ### how do i surpress an error message for a foreach statement? ### ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ### -- Richard Whitney * Transcend

RE: [PHP] foreach statement

2003-03-25 Thread Jennifer Goodie
You don't. From http://www.php.net/manual/en/control-structures.foreach.php Note: foreach does not support the ability to suppress error messages using '@'. You should check the validity of your argument before passing it to foreach if(is_array($array)){ foreach($array as $key=$val){

Re: [PHP] foreach statement

2003-03-25 Thread Jim Lucas
] To: shaun [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 3:34 PM Subject: RE: [PHP] foreach statement You don't. From http://www.php.net/manual/en/control-structures.foreach.php Note: foreach does not support the ability to suppress error messages using '@'. You should

RE: [PHP] IF statement madness

2003-03-14 Thread Johnson, Kirk
Comparing a float with an integer can have problems. You could try something like: if(abs($i - $target) .1) { //then they are essentially equal } Kirk -Original Message- From: James E Hicks III [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2003 11:22 AM To: [EMAIL

Re: [PHP] IF statement madness

2003-03-14 Thread Ernest E Vogelsinger
At 19:21 14.03.2003, James E Hicks III said: [snip] Help save my sanity! What can I do to the IF statement in the following code to make it print the line that says By God they are equal in value.? I have tried the following changes; 1. using ===

RE: [PHP] IF statement madness

2003-03-14 Thread jon roig
What happens if you change $target to 216.0? -- jon -Original Message- From: James E Hicks III [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2003 1:22 PM To: [EMAIL PROTECTED] Subject: [PHP] IF statement madness Help save my sanity! What can I do to the IF statement in the

RE: [PHP] IF statement madness

2003-03-14 Thread Ford, Mike [LSS]
-Original Message- From: James E Hicks III [mailto:[EMAIL PROTECTED] Sent: 14 March 2003 18:22 Help save my sanity! What can I do to the IF statement in the following code to make it print the line that says By God they are equal in value.? I have tried the following changes;

RE: [PHP] IF statement madness

2003-03-14 Thread James E Hicks III
Thank you (all who resonded)!!! It makes sense now. Now I can wait until 5:00pm, quitting time, to go crazy!! James -Original Message- From: Johnson, Kirk [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2003 1:23 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] IF statement madness

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Martin Towell
I've been using this: if (in_array($value, array(foo, bar, blah))) { // do something } but if you want to use a switch/case, I don't know any easier way. HTH Martin -Original Message- From: CF High [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2003 1:41 PM To: [EMAIL

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
Check the manual: switch($foo) { case fee: case fie: ... break; case fo: ... case fum: ... break; } fee fie are tied together, fie will also run the code presented by fum ... Even

Re: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Leif K-Brooks
switch($value){ case 'foo': case 'bar': //It's either foo or bar break; } CF High wrote: Hey all. In Cold Fusion I was able to do the following: CFSWITCH expression = #action# CFCASE value = getUpdate,getDelete Do Stuff /CFCASE /CFSWITCH Note the comma

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
Duh. make that fo will also run the code presented by fum ... -Original Message- From: Mark Charette [mailto:[EMAIL PROTECTED] switch($foo) { case fee: case fie: ... break; case fo: ... case fum:

RE: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread John W. Holmes
I've got a simple switch statement that carries out one of several operations based on the switch statement variable value. Each operation has @ 50 lines of html -- do I have to echo or print all this html!? You could put your HTML into a separate file and just include() it wherever you

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Johannes Schlueter
On Saturday 25 January 2003 20:38, CF High wrote: Each operation has @ 50 lines of html -- do I have to echo or print all this html!? Try something like ?php switch ($foo) { case 1: ? h1Hello/h1 ?php break; } ? johannes -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Switch statement || How to output html without using echo()or print()

2003-01-25 Thread Leif K-Brooks
No. You can either echo/print with a heredoc (which is still echoing/printing, but is a lot easier) or you can exit PHP. For example: ?php switch($somevar){ case 'case1': print END some html some html some html END; break; case 'case2': print END some html some html some html END; break; } ?

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Noah
PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, January 25, 2003 8:38 AM Subject: Re: [PHP] Switch statement || How to output html without using echo() or print() On Saturday 25 January 2003 20:38, CF High wrote: Each operation has @ 50 lines of html -- do I have to echo or print all

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Noah
: John W. Holmes [EMAIL PROTECTED] To: 'CF High' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, January 25, 2003 8:42 AM Subject: RE: [PHP] Switch statement || How to output html without using echo() or print() I've got a simple switch statement that carries out one of several operations

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread CF High
Thanks for the informative response, Leif. Looks like you and Johannes are on the same page -- these solutions save a great deal of time. Thanks, --Noah Leif K-Brooks [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... No. You can either echo/print with a heredoc

Re: [PHP] case statement?

2002-12-19 Thread Chris Wesley
On Thu, 19 Dec 2002, Max Clark wrote: I was wondering if php had a case function? Instead of building a large if/elseif/else block I would like to do a case $page in (list). switch function ... http://www.php.net/manual/en/control-structures.switch.php ~Chris -- PHP General

RE: [PHP] case statement?

2002-12-19 Thread Ford, Mike [LSS]
-Original Message- From: Max Clark [mailto:[EMAIL PROTECTED]] Sent: 19 December 2002 18:19 I was wondering if php had a case function? Instead of building a large if/elseif/else block I would like to do a case $page in (list). http://www.php.net/control-structures.switch

Re: [PHP] case statement?

2002-12-19 Thread Manuel Ochoa
Yes, It's called SWITCH Just go to www.php.net and lookup switch in the function list Max Clark [EMAIL PROTECTED] wrote:Hi- I was wondering if php had a case function? Instead of building a large if/elseif/else block I would like to do a case $page in (list). Thanks in advance, Max --

Re: [PHP] case statement?

2002-12-19 Thread Mark Charette
On Thu, 19 Dec 2002, Max Clark wrote: Hi- I was wondering if php had a case function? Instead of building a large if/elseif/else block I would like to do a case $page in (list). The documentation and search capabilities at http://www.php.net are your frientd. It would behhove you to at

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Ernest E Vogelsinger
At 13:50 26.11.2002, [EMAIL PROTECTED] said: [snip] I'll be trying to use a routine that checks 4 seperate variables for content and need to know the easiest method to do so. The function works on 2 conditions; either all the variables are empty and I do

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread ed
All four must be an empty string. I will be pulling the values from a MySQL database. If these fields are empty I'll be prompting for information. If any one of them contain anything I'll be showing it to the user and asking if they want to change it. Thanks, Ed On Tue, 26 Nov 2002, Ernest E

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread DL Neil
Ed, Assuming there will be a response from the db-tbl, here is another choice: if ( $lineone . $linetwo . $linethree . $linefour ) { //show it to the user and ask if they want to change it } else { //prompt for information } Do you mean that the db-tbl will have a row of data even if the

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread ed
The db will include these 4 rows even though they don't store data. Eventually they will contain data for contact info as soon as the users log in and it prompts them for it. On Tue, 26 Nov 2002, DL Neil wrote: Ed, Assuming there will be a response from the db-tbl, here is another choice:

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Craig
Something like this will work... ?php if(empty($_GET['1']) empty($_GET['2']) empty($_GET['3']) empty($_GET['4'])){ echo All vars are EMPTY; }else{ echo Some vars contain Content; } ? [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... The db will

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Chris Shiflett
--- Ernest E Vogelsinger [EMAIL PROTECTED] wrote: At 13:50 26.11.2002, [EMAIL PROTECTED] said: if ($lineone $linetwo $linethree $linefour = ) Your expression yields true if 1-3 are not-empty AND four is an empty string. Actually, this expression yields true when $lineone, $linetwo, and

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Jason Wong
On Tuesday 26 November 2002 23:45, Chris Shiflett wrote: --- Ernest E Vogelsinger [EMAIL PROTECTED] wrote: At 13:50 26.11.2002, [EMAIL PROTECTED] said: if ($lineone $linetwo $linethree $linefour = ) Your expression yields true if 1-3 are not-empty AND four is an empty string.

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Chris Shiflett
--- Jason Wong [EMAIL PROTECTED] wrote: At 13:50 26.11.2002, [EMAIL PROTECTED] said: if ($lineone $linetwo $linethree $linefour = ) Actually that expression will always be FALSE. $linefour = does not evaluate to TRUE thus the whole expression to be FALSE! Yes, you're right. Of course, I

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Ernest E Vogelsinger
At 16:45 26.11.2002, Chris Shiflett spoke out and said: [snip] --- Ernest E Vogelsinger [EMAIL PROTECTED] wrote: At 13:50 26.11.2002, [EMAIL PROTECTED] said: if ($lineone $linetwo $linethree $linefour = ) Your expression yields true if 1-3 are

Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Chris Shiflett
--- Ernest E Vogelsinger [EMAIL PROTECTED] wrote: if ($lineone $linetwo $linethree $linefour = ) Your expression yields true if 1-3 are not-empty AND four is an empty string. Actually, this expression yields true when $lineone, $linetwo, and $linethree are all true. The variable

Re: [PHP] conditional statement problems

2002-10-01 Thread Tom Rogers
Hi, Tuesday, October 1, 2002, 5:11:08 PM, you wrote: PO $title_err = ($adTitle == ) ? 1 : strlen($adTitle) 50 ? 2 : 0; PO Can anyone tell me why this is not evaluating correctly (returning a PO value of 1) when $adTitle is an empty string? It is right according to your expression, try

Re: [PHP] conditional statement problems

2002-10-01 Thread René Moonen
Pablo Oliva wrote: $title_err = ($adTitle == ) ? 1 : strlen($adTitle) 50 ? 2 : 0; Can anyone tell me why this is not evaluating correctly (returning a value of 1) when $adTitle is an empty string? I have no idea... but if you change your code to this, it works: $title_err = ($adTitle ==

Re: [PHP] conditional statement problems

2002-10-01 Thread René Moonen
René Moonen wrote: Pablo Oliva wrote: $title_err = ($adTitle == ) ? 1 : strlen($adTitle) 50 ? 2 : 0; Can anyone tell me why this is not evaluating correctly (returning a value of 1) when $adTitle is an empty string? I have no idea... but if you change your code to this, it works:

RE: [PHP] conditional statement problems

2002-10-01 Thread Ford, Mike [LSS]
-Original Message- From: Pablo Oliva [mailto:[EMAIL PROTECTED]] Sent: 01 October 2002 08:11 To: [EMAIL PROTECTED] Subject: [PHP] conditional statement problems $title_err = ($adTitle == ) ? 1 : strlen($adTitle) 50 ? 2 : 0; Can anyone tell me why this is not evaluating

RE: [PHP] mysql statement (still a semi newbie)

2002-08-14 Thread vic
U must write: mysql_query(INSERT INTO cast SET Rick='$Rick', Blaine='$Blaine', Humphrey='$Humphrey', Bogart='$Bogart', male='$male'); The stuff with the $ before them are variable that contain the info u want to put into the word that don't have the $ those words are the cells in your database.

RE: [PHP] switch statement question

2002-08-13 Thread Jay Blanchard
[snip] Say i have a variable $string_var = Once upon a time; is there a way to do this: Switch($string_var) { case(contains Once): doSomething(); break; case(contains the end.) doOtherThing(); break; case(contains time) doNothing(); break; default: echo ERROR }

Re: [PHP] switch statement question

2002-08-13 Thread DL Neil
Alternatively Alexander, take a look at the string functions eg strstr(), stristr(), and strpos() all of which can be used to make a condition within the case() criteria. Regards, =dn [snip] Say i have a variable $string_var = Once upon a time; is there a way to do this:

RE: [PHP] selcet statement question

2002-07-26 Thread Jay Blanchard
[snip] I know that i can retrieve records 1-24 in my db with a select statement like SELECT whatever FROM tablename ORDER BY id ASC LIMIT 23, but how can I get records 25 to 50 if I have 100 records in my DB? [/snip] Different DB's have differing ways of doing this, like MySQL; SELECT * FROM

RE: [PHP] if statement

2002-07-08 Thread Martin Towell
You can do this: if ($type == test1 || $type == test2 || $type == test3) { or, what I prefer in this case if (in_array($type, array(test1, test2, test3))) { Martin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 09, 2002 2:11 PM To:

Re: [PHP] SQL Statement

2002-06-19 Thread w . w . w
this is the problem: $query = Select OSUSER From v$session Where USERNAME = (Select USER From DUAL) And AUDSID =(Select USERENV('SESSIONID') From DUAL); 1. mysql does NOT support subselects! 2. delete the in front of FROM 3. you have to quote v$session: v\$session start with a short query

Re: [PHP] SQL Statement

2002-06-19 Thread èdy kurniawan
('SESSIONID') From DUAL); great thanks in advance to michi... ^_^ - Original Message - From: èdy kurniawan [EMAIL PROTECTED] Subject: Re: [PHP] SQL Statement thanks to michi for ASAP response... but I thought your opinion not actually right.. I've a sql : $query = Select dfl_desc

Re: [PHP] include statement errors -- something missing

2002-06-18 Thread Doug DeVries
I've tried a hundred different things -- YOURS WORKED! Thank you very much! -Doug - Original Message - From: Niklas Lampén [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Monday, June 17, 2002 10:45 PM Subject: RE: [PHP] include statement errors -- something missing So far

<    1   2   3   >