Re: [PHP] help with script needed

2007-03-13 Thread Stut
Richard Lynch wrote: You could also just use: if (($i % 15) === 0) echo "FooBar"; elseif (($i % 3) === 0) echo "Foo"; elseif (($i % 5) === 0) echo "Bar"; 15 works because 3 and 5 are mutually prime or whatever it's called. Good point, missed that one. A minimalist might not even bother with

Re: [PHP] help with script needed

2007-03-12 Thread Richard Lynch
You could also just use: if (($i % 15) === 0) echo "FooBar"; elseif (($i % 3) === 0) echo "Foo"; elseif (($i % 5) === 0) echo "Bar"; 15 works because 3 and 5 are mutually prime or whatever it's called. The order matters, though, as moving the 15 "after" the other if tests would fail, as 3 and/or

Re: [PHP] help with script needed

2007-03-08 Thread Jochem Maas
Stut wrote: > Bruce Gilbert wrote: >> Thanks for the responses so far. >> >> This is what I have come up with >> [php] >> > for( $i=1; $i<=100; $i++ ) >> { >> echo $i; >> echo ""; >> if ($i%3 == 0) echo "Foo "; >> elseif ($i%5 == 0) echo "Bar"; >> } >> >> ?> >> [/php] >> >> and the results can be s

Re: [PHP] help with script needed

2007-03-07 Thread Jake McHenry
LOL I told'ya I rememberd it from my 2nd semester :) Ok, this is commonly known as the FizzBuzz problem and is used a lot as a university project or interview question. If you can't do it, be afraid!! http://dev.stut.net/php/fizzbuzz.php -Stut -- PHP General Mailing List (http://www.php.net

Re: [PHP] help with script needed

2007-03-07 Thread Stut
Bruce Gilbert wrote: Thanks for the responses so far. This is what I have come up with [php] "; if ($i%3 == 0) echo "Foo "; elseif ($i%5 == 0) echo "Bar"; } ?> [/php] and the results can be seen here http://www.inspired-evolution.com/image_test/numbers_output.php I actually want the Foo and B

Re: [PHP] help with script needed

2007-03-07 Thread Jake McHenry
TECTED]> To: "Martin Marques" Cc: "Tijnema !" <[EMAIL PROTECTED]>; "PHP-General" Sent: Wednesday, March 07, 2007 4:00 PM Subject: Re: [PHP] help with script needed Thanks for the responses so far. This is what I have come up with [php] "; if ($

Re: [PHP] help with script needed

2007-03-07 Thread Bruce Gilbert
Thanks for the responses so far. This is what I have come up with [php] "; if ($i%3 == 0) echo "Foo "; elseif ($i%5 == 0) echo "Bar"; } ?> [/php] and the results can be seen here http://www.inspired-evolution.com/image_test/numbers_output.php I actually want the Foo and Bar to replace the numb

Re: [PHP] help with script needed

2007-03-07 Thread Martin Marques
Tijnema ! escribió: On 3/7/07, Bruce Gilbert <[EMAIL PROTECTED]> wrote: I just need to add code to print something different, say "foo" if the output is a multiple of 5 or 10 for example. How do I go about doing this? I've seen that question a lot, what i use is fairly simple if( intval($numb

Re: [PHP] help with script needed

2007-03-07 Thread Jake McHenry
lol . i remember this from a 2nd semester quiz 5 years ago :) I have a little script that prints a number out from 1 to 100 [php] "; } ?> [/php] I just need to add code to print something different, say "foo" if the output is a multiple of 5 or 10 for example. How do I go about doing

Re: [PHP] help with script needed

2007-03-07 Thread Tijnema !
oops, ofcourse whe have the modular :) On 3/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: try this if ($i%5 == 0) echo "foo"; -afan > I have a little script that prints a number out from 1 to 100 > [php] > for( $i=1; $i<=100; $i++ ) > { > echo $i; > echo ""; > > } > ?> > [/php] > > I ju

Re: [PHP] help with script needed

2007-03-07 Thread afan
try this if ($i%5 == 0) echo "foo"; -afan > I have a little script that prints a number out from 1 to 100 > [php] > for( $i=1; $i<=100; $i++ ) > { > echo $i; > echo ""; > > } > ?> > [/php] > > I just need to add code to print something different, say "foo" if the > output is a multiple of 5 or 1

Re: [PHP] help with script needed

2007-03-07 Thread Tijnema !
On 3/7/07, Bruce Gilbert <[EMAIL PROTECTED]> wrote: I have a little script that prints a number out from 1 to 100 [php] "; } ?> [/php] I just need to add code to print something different, say "foo" if the output is a multiple of 5 or 10 for example. How do I go about doing this? -- ::Bruce::

Re: [PHP] help with script!!!

2003-02-02 Thread Sunfire
?", $array[id], $array[username], $array[password], $array[status], $array[notes]); } and make sure that your array indexes are right they are case sensitive in mysql...so array[id] is different than array[Id] or array[ID]... - Original Message - From: "Karl James" <[EMAIL PROTECTED]> To:

Re: [PHP] help with script!!!

2003-02-02 Thread Philip Olson
On Sat, 1 Feb 2003, Hugh Danaher wrote: > echo("| %s | %s | %s | %s | %s |", $array[id], $array[username], > $array[password], $array[status], $array[notes]); > > try > echo "| %s | %s | %s | %s | %s |".$array[id]." ".$array[username]." > ".$array[password]." ".$array[status]." ".$array[notes]; >

Re: [PHP] help with script!!!

2003-02-01 Thread Philip Olson
On Sat, 1 Feb 2003, Karl James wrote: > Hello guys and gals!!! > > can you tell me why i can't get this script to print my > table > > thanks Karl > > please check out the code below > obviously i left my username and passwords blank :-) > > > -

Re: [PHP] help with script!!!

2003-02-01 Thread Hugh Danaher
echo("| %s | %s | %s | %s | %s |", $array[id], $array[username], $array[password], $array[status], $array[notes]); try echo "| %s | %s | %s | %s | %s |".$array[id]." ".$array[username]." ".$array[password]." ".$array[status]." ".$array[notes]; dots not comas between variables. Hope this helps. Hu

Re: [PHP] help with script

2003-01-01 Thread Michael J. Pawlowsky
There's your answer... You do not have permission to insert into the database with that user. Contact your DBA! :-) and if that's you read the MySQL manual. Especially about the mysql.user table *** REPLY SEPARATOR *** On 01/01/2003 at 1:19 PM Karl James wrote: > >Access d

Re: [PHP] help with script!!

2003-01-01 Thread Justin French
on 02/01/03 7:54 AM, Karl James ([EMAIL PROTECTED]) wrote: > can someone take a look at this > and see why this wont work. why don't you start by telling us what's wrong, or HOW it "doesn't work"? Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.n

Re: [PHP] help with script!!

2003-01-01 Thread Michael J. Pawlowsky
Without the error message you are making it kind of tough. What's the response that you get. Also you should use long HYPERLINK >"http://host.makethewebsecure.com/~admin12/do_adduser.phps"http://host.m >akethewebsecure.com/~admin12/do_adduser.phps > > >can someone take a look at this >and see

RE: [PHP] Help with script - if possible

2002-08-28 Thread Richard Black
Try putting brackets round the date selection part. I think the database treats AND with a higher precedence than OR, and evaluates ANDs first. So what your query is doing is like A OR (B AND C) But what you want is (A OR B) AND C Where A is '$book_start_date' BETWEEN booking_start AND booki