Re: [PHP] What's wrong with this code?

2010-06-05 Thread Karl DeSaulniers
Could the exit() be terminating it? Do you need this exit() as the else for that if statement? Try deleting just the else {}. JAT Karl Sent from losPhone On Jun 5, 2010, at 6:54 PM, David Mehler dave.meh...@gmail.com wrote: Hello, I've got a while loop outputting values from a database.

Re: [PHP] What's wrong with this code?

2010-06-05 Thread David Mehler
Hi, Thanks. I took out the entire else section including the exit call, it now all processes, however $row['enddate'] is not displayed on the two records where it is set. Thanks. Dave. On 6/5/10, Karl DeSaulniers k...@designdrumm.com wrote: Could the exit() be terminating it? Do you need this

Re: [PHP] What's wrong with this code?

2010-06-05 Thread Karl DeSaulniers
So your code looks like this? while($row = mysql_fetch_array($result3)) { echo tr; echo td . $row['name'] . /td; echo td . $row['type'] . /td; echo td . $row['startdate'] . /td; if (!empty($row['EndDate'])) { //This should probably be $row ['enddate'] echo td . $row['enddate'] . /td; } echo

Re: [PHP] What's wrong with this code?

2010-06-05 Thread Mari Masuda
Could it be that you are not using the same variable name? In the if statement you are using $row['EndDate'] and when attempting to print you are using $row['enddate']. I think you need to be consistent about which capitalization you use (and make sure it matches what is in the db). if

Re: [PHP] What's wrong with this code?

2010-06-05 Thread David Mehler
Hello everyone, Much thanks. Sometimes when you stare at code for so long it blurs together, that's how it is with me at least. That was my problem, case sensitive variable. Thanks a lot. Dave. On 6/5/10, Mari Masuda mari.mas...@stanford.edu wrote: Could it be that you are not using the same

RE: [PHP] What's wrong with this code please?

2004-02-24 Thread Sam Masiello
If you want to see the contents of an array, use the print_r function: http://www.php.net/print_r HTH! --Sam Donpro wrote: $emails = array([EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]); $addresses = explode(,,$emails); for ($i=0; $i count($addresses); $i++) { echo $i . ':

Re: [PHP] What's wrong with this code please?

2004-02-24 Thread Adam Bregenzer
On Tue, 2004-02-24 at 12:51, Donpro wrote: $emails = array([EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]); $addresses = explode(,,$emails); for ($i=0; $i count($addresses); $i++) { echo $i . ': ' . $addresses[$i] . 'br'; if ($i == count($addresses) - 1)

RE: [PHP] What's wrong with this code please?

2004-02-24 Thread Chris W. Parker
Donpro mailto:[EMAIL PROTECTED] on Tuesday, February 24, 2004 9:52 AM said: $emails = array([EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]); $addresses = explode(,,$emails); for ($i=0; $i count($addresses); $i++) { echo $i . ': ' . $addresses[$i] . 'br'; if ($i ==

RE: [PHP] What's wrong with this code??

2003-05-31 Thread Jennifer Goodie
Problem lines if ($mo == 06 and $dy 01 and $dy 09) { $wd = 8; } if ($mo == 06 and $dy 08) { $wd = 9; } but if I change my date to 06/02 then no matter what I try, $wd always gets the value of 9 (it should be 8 on this date). It should not get the value 9 until the 9th

Re: [PHP] What's wrong with this code??

2003-05-31 Thread Ernest E Vogelsinger
At 01:08 30.04.2003, Beauford said: [snip] if ($mo == 06 and $dy 01 and $dy 09) { $wd = 8; } if ($mo == 06 and $dy 08) { $wd = 9; } [snip] The problem is your notation. If you had written if ($mo == 6 and $dy

Re: [PHP] What's wrong with this code??

2003-05-31 Thread Beauford
think of any other way of doing it. Any suggestions? Thanks - Original Message - From: Ernest E Vogelsinger [EMAIL PROTECTED] To: Beauford [EMAIL PROTECTED] Cc: PHP General [EMAIL PROTECTED] Sent: Friday, May 30, 2003 7:39 PM Subject: Re: [PHP] What's wrong with this code?? At 01:08

Re: [PHP] What's wrong with this code??

2003-05-31 Thread Brian V Bonini
On Fri, 2003-05-30 at 20:02, Beauford wrote: Your right though, the code is awkward - but I couldn't think of any other way of doing it. Any suggestions? switch http://us4.php.net/manual/en/control-structures.switch.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] What's wrong with this code??

2003-05-31 Thread Beauford
] To: Beauford [EMAIL PROTECTED] Cc: PHP General [EMAIL PROTECTED] Sent: Friday, May 30, 2003 9:18 PM Subject: Re: [PHP] What's wrong with this code?? On Fri, 2003-05-30 at 20:02, Beauford wrote: Your right though, the code is awkward - but I couldn't think of any other way of doing it. Any

Re: [PHP] What's wrong with this code?

2001-05-22 Thread Plutarck
Ahh, so you can use \\n within the regex itself...I was thinking that what was capture in the regex itself wasn't available until the replace part. Obviously that's not true ;) Thanks alot, everyone! One problem down, all the other one's to go :) Plutarck Christian Reiniger [EMAIL PROTECTED]

Re: [PHP] What's wrong with this code?

2001-05-21 Thread CC Zona
In article 9eb4nf$pdf$[EMAIL PROTECTED], [EMAIL PROTECTED] (Plutarck) wrote: $file = eregi_replace(script.*.*/script, !-- RWW: Scripting killed --, $file); But I use PCRE functions, so I don't want to use ereg in one place and PCRE in another, so I tried: $file =

Re: [PHP] What's wrong with this code?

2001-05-21 Thread Rasmus Lerdorf
But I use PCRE functions, so I don't want to use ereg in one place and PCRE in another, so I tried: $file = preg_replace(#script.*.*/script#i, !-- RWW: Scripting killed --, $file); '/script.*.*?\/script/i' -Rasmus -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] What's wrong with this code?

2001-05-21 Thread Plutarck
Since there is a / in the code itself, I use # as a delimiter instead so I don't have to escape it, making it harder to read. So here's the code: $file = preg_replace(#script.*.*/script#Ui, !-- RWW: Scripting killed --, $file); Which works...kinda. But here's the weird thing. This is a piece

Re: [PHP] What's wrong with this code?

2001-05-21 Thread Christian Reiniger
On Monday 21 May 2001 16:23, Plutarck wrote: Since there is a / in the code itself, I use # as a delimiter instead so I don't have to escape it, making it harder to read. So here's the code: $file = preg_replace(#script.*.*/script#Ui, !-- RWW: Scripting killed --, $file); Stupid error

Re: [PHP] What's wrong with this code?

2001-05-21 Thread Plutarck
Doh! I read the part about what . does and it didn't even register that it won't match newlines. Well now that part works ;) And now one more bit. For instance to kill an onclick event I use: $file = preg_replace(#(.*)onclick=\.*\(.*)#isU, \\1\\2, $file); Which works, kinda. Problem is,

Re: [PHP] What's wrong with this code?

2001-05-21 Thread Christian Reiniger
On Tuesday 22 May 2001 05:06, Plutarck wrote: And now one more bit. For instance to kill an onclick event I use: $file = preg_replace(#(.*)onclick=\.*\(.*)#isU, \\1\\2, $file); Which works, kinda. Problem is, consider this: onclick='somecode()' It's not caught, because it only catches

Re: [PHP] What's wrong with this code?

2001-04-23 Thread Alexander Wagner
Tyler Longren wrote: $file = fopen(includes/about.inc, r); $data = fread($file, 2400); [..] Any ideas why that doesn't work on one server but it will work on another server? The server it works on is Win2k, IIS5, php4.0.4pl1. The server it doesn't work on is Linux, Apache, php4.0.4pl1.

Re: [PHP] What's wrong with this code?

2001-04-23 Thread Chris Fry
I think you need to specify the full path rather than relative when using fopen eg: $file = fopen(/usr/local/apache/htocs/includes/about.inc, r); Chris Alexander Wagner wrote: Tyler Longren wrote: $file = fopen(includes/about.inc, r); $data = fread($file, 2400); [..] Any ideas why

Re: [PHP] What's wrong with this code?

2001-04-23 Thread Geir Eivind Mork
On Monday 23 April 2001 08:59, Alexander Wagner wrote: Tyler Longren wrote: $file = fopen(includes/about.inc, r); $data = fread($file, 2400); $file = includes/about.inc; if ($fp = fopen($file,r)) { $data = fread($fp,filesize($file)); fclose($fp); } ought to work. -- php