Re: [PHP] Logic of conditionals and the ( ) operators

2009-12-18 Thread Jonathan Tapicer
Hi, Yes, what Ashley said is correct. Also, if you want to avoid writing $perm several times in the if, or if you have a lot of permissions you can do: if (in_array($perm, array(11, 22))) And you can put in that array all the permissions you need to. Regards, Jonathan On Fri, Dec 18, 2009 at

Re: [PHP] Logic of conditionals and the ( ) operators (RESOLVED)

2009-12-18 Thread Allen McCabe
Thank you Ashley, it makes perfect sense. I don't know why I didn't just set up some tests like Shiplu suggested! I've rewritten all my code BACK to the correct way. (I thought it looked cooler, oh well). On Fri, Dec 18, 2009 at 10:47 AM, Ashley Sheridan wrote: > On Fri, 2009-12-18 at 10:21 -0

Re: [PHP] Logic of conditionals and the ( ) operators

2009-12-18 Thread Ashley Sheridan
On Fri, 2009-12-18 at 10:21 -0800, Allen McCabe wrote: > In a nutshell: > > Will this work? > > if ($perm == (11 || 12)) > > > Explanation: > > I am laying the groundwork for a photo viewing system with a private and > public mode, and additionally if an admin is logged in, there is an > addi

[PHP] Logic of conditionals and the ( ) operators

2009-12-18 Thread Allen McCabe
In a nutshell: Will this work? if ($perm == (11 || 12)) Explanation: I am laying the groundwork for a photo viewing system with a private and public mode, and additionally if an admin is logged in, there is an additional level of permission. I came up with a number system to make it easier (an

Re: [PHP] logic operands problem

2009-12-07 Thread Merlin Morgenstern
1 OR page = 3 AND page != 2) OR (page = 2 OR page = 3 AND page != 1) Has somebody an idea how to solve this? I've read the entire thread and can see that this is a MySQL query you want to make (I was about to tell you about the == comparison and the $ in a variable in PHP). What you want is all results containing 1,2 or 3, so make a "WHERE page IN(1,2,3)" and use PHP logic to figure out if a free slot is available or not. Or rewrite your booking routine (use data and time fields instead, maybe by creating a bunch of free slots and then a booked field with a default of "0", changed to "1" when booked)

Re: [PHP] logic operands problem

2009-12-07 Thread tedd
At 11:52 AM +0100 12/7/09, Merlin Morgenstern wrote: Hello everybody, I am having trouble finding a logic for following problem: Should be true if: page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 The result should never contain 1 AND 2 in the same time. This obviously

Re: [PHP] logic operands problem

2009-12-07 Thread Kim Madsen
nt to make (I was about to tell you about the == comparison and the $ in a variable in PHP). What you want is all results containing 1,2 or 3, so make a "WHERE page IN(1,2,3)" and use PHP logic to figure out if a free slot is available or not. Or rewrite your booking routine (use data

Re: [PHP] logic operands problem

2009-12-07 Thread Lester Caine
Merlin Morgenstern wrote: You have described the problem very well. This is exactly where I can not find a solution. the page number translates to the following: 1= first page 2= following pages 3= all pages This are the options a user has while booking a product on my site. Now if ther is

Re: [PHP] logic operands problem

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 12:49 +0100, Merlin Morgenstern wrote: > > Ashley Sheridan wrote: > > On Mon, 2009-12-07 at 11:52 +0100, Merlin Morgenstern wrote: > >> Hello everybody, > >> > >> I am having trouble finding a logic for following problem: > >> > >> Should be true if: > >> page = 1 OR page =

Re: [PHP] logic operands problem

2009-12-07 Thread Merlin Morgenstern
Ashley Sheridan wrote: On Mon, 2009-12-07 at 11:52 +0100, Merlin Morgenstern wrote: Hello everybody, I am having trouble finding a logic for following problem: Should be true if: page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 The result should never contain 1 AND 2

Re: [PHP] logic operands problem

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 11:52 +0100, Merlin Morgenstern wrote: > Hello everybody, > > I am having trouble finding a logic for following problem: > > Should be true if: > page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 > > The result should never contain 1 AND 2 in the sam

Re: [PHP] logic operands problem

2009-12-07 Thread Merlin Morgenstern
Devendra Jadhav wrote: what do you think about this? if( ! (page == 1 && page == 2)){ //here } Well a simple && (and) does not help. I want to have all results that contain either page = 1 OR page = 3, AND in the same time I want to have the results that contain page=2 OR page= 3 , B

Re: [PHP] logic operands problem

2009-12-07 Thread Devendra Jadhav
what do you think about this? if( ! (page == 1 && page == 2)){ //here } On Mon, Dec 7, 2009 at 4:22 PM, Merlin Morgenstern wrote: > Hello everybody, > > I am having trouble finding a logic for following problem: > > Should be true if: > page = 1 OR page = 3, but it should also be true if pa

[PHP] logic operands problem

2009-12-07 Thread Merlin Morgenstern
Hello everybody, I am having trouble finding a logic for following problem: Should be true if: page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 The result should never contain 1 AND 2 in the same time. This obviously does not work: (page = 1 OR page = 3) OR (page = 2 OR

Re: [PHP] Logic puzzle. Not a question. Just for fun

2009-01-06 Thread Chris
If this seems simple to you remember I have no formal training in logic structure or DB design Neither do I - and probably a lot of others here too ;) the value of a status field is given in the sdk text as such... ...This number is determined by adding the following values togeth

[PHP] Logic puzzle. Not a question. Just for fun

2009-01-06 Thread Frank Stanovcak
This is verbatim from the manufacturer except I replaced the code info with vanilia filler to keep from getting in trouble with them. See how long it takes you to write the shortest SQL code that returns all State a and State f records. If this seems simple to you remember I have no formal trai

Re: [PHP] logic for grabbing what we need from user-input addresses for AVS?

2008-10-19 Thread Ashley Sheridan
On Sun, 2008-10-19 at 11:26 -0400, Robert Cummings wrote: > On Sun, 2008-10-19 at 10:03 +0100, Ashley Sheridan wrote: > > On Sun, 2008-10-19 at 01:10 -0400, Robert Cummings wrote: > > > On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote: > > > > Hi all > > > > > > > > This is not exactly PHP, but a

Re: [PHP] logic for grabbing what we need from user-input addresses for AVS?

2008-10-19 Thread Robert Cummings
On Sun, 2008-10-19 at 10:03 +0100, Ashley Sheridan wrote: > On Sun, 2008-10-19 at 01:10 -0400, Robert Cummings wrote: > > On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote: > > > Hi all > > > > > > This is not exactly PHP, but an issue that we have to work out in code > > > (whatever we use) - >

Re: [PHP] logic for grabbing what we need from user-input addresses for AVS?

2008-10-19 Thread Govinda
On Oct 18, 2008, at 11:10 PM, Robert Cummings wrote: On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote: To cut down on fraudulent orders, our cc processor (whatever we call them), to enable "Address Verification System (AVS)", ... The docs make this clear that they want: "The numeric port

Re: [PHP] logic for grabbing what we need from user-input addresses for AVS?

2008-10-19 Thread Ashley Sheridan
On Sun, 2008-10-19 at 01:10 -0400, Robert Cummings wrote: > On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote: > > Hi all > > > > This is not exactly PHP, but an issue that we have to work out in code > > (whatever we use) - > > I am working on a shopping cart site which will have orders from any

Re: [PHP] logic for grabbing what we need from user-input addresses for AVS?

2008-10-18 Thread Robert Cummings
On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote: > Hi all > > This is not exactly PHP, but an issue that we have to work out in code > (whatever we use) - > I am working on a shopping cart site which will have orders from any > country. > > To cut down on fraudulent orders, our cc processor

Re: [PHP] logic for grabbing what we need from user-input addresses for AVS?

2008-10-18 Thread Waynn Lue
AVS generally only exists for us and canada and parts of the uk, if I remember correctly. Usually they're just looking for the beginning part of the street address, not the concatenation or anything else like that. No need for apartment numbers, for example if you're just looking at avs. If you're

[PHP] logic for grabbing what we need from user-input addresses for AVS?

2008-10-18 Thread Govinda
Hi all This is not exactly PHP, but an issue that we have to work out in code (whatever we use) - I am working on a shopping cart site which will have orders from any country. To cut down on fraudulent orders, our cc processor (whatever we call them), to enable "Address Verification Syste

Re: [PHP] Logic sought

2008-07-09 Thread Per Jessen
tedd wrote: > If two, or more, users hit the site at the same time then a RACE > condition may have one user getting something they didn't ask for or > not getting anything at all. > > The complicated way I figure I could solve this would be to: > > 1. Generate a random string name for the file

Re: [PHP] Logic sought

2008-07-09 Thread Jim Lucas
tedd wrote: Hi gang: Here's the logic problem. First the site: http://php1.net/b/zip-files/ Now, the site works well enough. The user selects what they want, clicks Submit, the order is assembled in zip file and presented to the user for downloading. However, as it stands now, before the

Re: [PHP] Logic sought

2008-07-09 Thread Nathan Nobbe
On Wed, Jul 9, 2008 at 6:11 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > generate a unique hash as the name based on the contents of the zip, then > if 2 people > happen to want exactly the same selection you won't have to build/zip it > twice ... > just check if the zip happens to exist before tr

Re: [PHP] Logic sought

2008-07-09 Thread Jochem Maas
generate a unique hash as the name based on the contents of the zip, then if 2 people happen to want exactly the same selection you won't have to build/zip it twice ... just check if the zip happens to exist before trying to build it. have the script do garbage collection on old zip files ... i

Re: [PHP] Logic sought

2008-07-09 Thread Eric Butera
On Wed, Jul 9, 2008 at 7:45 PM, tedd <[EMAIL PROTECTED]> wrote: > Hi gang: > > Here's the logic problem. > > First the site: > > http://php1.net/b/zip-files/ > > Now, the site works well enough. The user selects what they want, clicks > Submit, the order is assembled in zip file and presented to th

Re: [PHP] Logic sought

2008-07-09 Thread Kyle Browning
Write a script that cron runs that checks dates of files and removes 1 month old ones? On Wed, Jul 9, 2008 at 4:45 PM, tedd <[EMAIL PROTECTED]> wrote: > Hi gang: > > Here's the logic problem. > > First the site: > > http://php1.net/b/zip-files/ > > Now, the site works well enough. The user select

[PHP] Logic sought

2008-07-09 Thread tedd
Hi gang: Here's the logic problem. First the site: http://php1.net/b/zip-files/ Now, the site works well enough. The user selects what they want, clicks Submit, the order is assembled in zip file and presented to the user for downloading. However, as it stands now, before the script assemb

Re: [PHP] Logic Help please

2007-11-22 Thread Richard Heyes
Hi, I am doing an online calendar for holiday application. Now I got a table with these fields among many others. `req_id` int(11) NOT NULL auto_increment, `req_date` date NOT NULL, `username` varchar(100) NOT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, `days_off` int

[PHP] Logic Help please

2007-11-22 Thread Mohamed Jama
Hi, I am doing an online calendar for holiday application. Now I got a table with these fields among many others. `req_id` int(11) NOT NULL auto_increment, `req_date` date NOT NULL, `username` varchar(100) NOT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, `days_off` int(

Re: [PHP] logic with arrays

2004-12-15 Thread Jeffery Fernandez
Wee Keat wrote: Hey Jeff, How are you mate? Was lazying around and saw your email to the list. :) What exactly do you need help with? Is it the following line? // Stuck here $html_menu .= "$sub_page"; } $html_menu .= ''; Do you need to get the value of the link and

Re: [PHP] logic with arrays

2004-12-15 Thread Greg Donald
On Thu, 16 Dec 2004 13:11:02 +1100, Jeffery Fernandez <[EMAIL PROTECTED]> wrote: > I am trying to build a html menu dynamically from data sitting in an > array. I have been successful so far until it came to the point of > populating the sub-menu of the system. Can someone help me out with the > lo

[PHP] logic with arrays

2004-12-15 Thread Jeffery Fernandez
I am trying to build a html menu dynamically from data sitting in an array. I have been successful so far until it came to the point of populating the sub-menu of the system. Can someone help me out with the logic or is there a simpler way of doing it? Thanks /** * This function builds the a

RE: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Ed Lazor
> -Original Message- > > Wow, Michael. Nice response. > > Could we please trim our posts? Thank you. Sorry. Thought I'd sent it to him only. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Jason Wong
On Thursday 12 August 2004 01:26, Ed Lazor wrote: > Wow, Michael. Nice response. Could we please trim our posts? Thank you. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development *

RE: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Ed Lazor
Wow, Michael. Nice response. -Ed > -Original Message- > From: Michael Sims [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 11, 2004 9:03 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] PHP logic - Whats going on here? > > Kim Steinhaug wrote: > [snip] >

RE: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Michael Sims
Michael Sims wrote: > string at various points to see what it contains. You may need to > drill down into the actual source code for the Send() method to see > what it things the body string is. Errr... s/things/thinks/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

RE: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Michael Sims
Kim Steinhaug wrote: [snip] > For some reason the above results in a blank mail, no $body at all, > rest is fine. However, if I include a dummy for if all goes well : > >if(!$mail->Send()) { > echo $lang_error['mailer_error'] . "\n"; >} else { > // Why do I need this one??? >

Re: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Paul Fierro
On 08/11/2004 9:28 AM, Kim Steinhaug <[EMAIL PROTECTED]> wrote: > Thanks for your reply, it all seems logical when you think of it, > still I also think it sounds logical without the extra ELSE statement > since the function has to executed for the first IF to do the comparison, > meaning that the

Re: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Kim Steinhaug
Thanks for your reply, it all seems logical when you think of it, still I also think it sounds logical without the extra ELSE statement since the function has to executed for the first IF to do the comparison, meaning that the email should be sendt in the first place. (If it didnt how could it stat

RE: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Jay Blanchard
[snip] Then to send the mail we use this : if(!$mail->Send()) { echo $lang_error['mailer_error'] . "\n"; } As you see above, Ive dropped the "what if all goes well" loop, since I believe that the $mail->Send() is initiaded in the first statement For some reason the above results i

[PHP] PHP logic - Whats going on here?

2004-08-11 Thread Kim Steinhaug
Ive stumbled onto a rather strange problem, atleast I cant see why this is happening. Im using phpMailer to send mails, and I have the following straight forward code : $mail = new phpmailer(); $mail->IsSendmail(); $mail->From = '[EMAIL PROTECTED]'; $mail->FromName = 'From Name'; $mail->

RE: [PHP] Logic problem

2004-04-20 Thread Alex Hogan
> What's in your array? $array1[0] = 'firstname'; $array1[1] = 'lastname'; $array1[2] = 'tkt_title'; I got that fixed. Thanks. alex hogan ** The contents of this e-mail and any files transmitted with it are confidential and i

Re: [PHP] Logic problem

2004-04-20 Thread John Nichel
Alex Hogan wrote: I gotcha.., I do have one question though. I ran your code and it only returns the first letter for that element in the array. For instance fieldone returns as f and tableone returns as t. The output looks like this; SELECT f,f,f FROM t,t. alex What's in your array? -- ***

RE: [PHP] Logic problem

2004-04-20 Thread Ford, Mike [LSS]
On 20 April 2004 16:44, Alex Hogan wrote: > foreach ( $array1 as $flds ) { > if ( $start ) { > $query .= $flds; > $start = false; > } else { > $query .= ", " . $flds; > > } > } $query .= implode(", ", $array1); Cheers! Mike --

Re: [PHP] Logic problem

2004-04-20 Thread Kelly Hallman
Apr 20 at 9:55am, Alex Hogan wrote: > function myselect($array1, $array2){ > $query = "SELECT".foreach($array1 as $flds){ $flds[$i]; }. > "FROM".foreach($array2 as $tbls){ $tbls[$n]; } ... Alex, if you merely wish to place the values of an array into your query, you might also try doing it th

RE: [PHP] Logic problem

2004-04-20 Thread Alex Hogan
[snip] I do have one question though. I ran your code and it only returns the first letter for that element in the array. For instance fieldone returns as f and tableone returns as t. The output looks like this; SELECT f,f,f FROM t,t. [/snip] Never mind I found it. It should be; $query = "SELEC

RE: [PHP] Logic problem

2004-04-20 Thread Alex Hogan
[snip] > $query = "SELECT "; > $start = true; > foreach ( $array1 as $flds ) { > if ( $start ) { > $query .= $flds[$i]; > $start = false; > } else { > $query .= ", " . $flds[$i]; > } > } > $query .= " FROM "; > $start = true; > foreach ( $

Re: [PHP] Logic problem

2004-04-20 Thread John Nichel
Alex Hogan wrote: Hi All, I am having a logic problem. (insert jokes here) I am trying to create a function that will allow me to pass any number of fields and tables into a blanket query. I am getting an error; Unexpected foreach. I have tried placing the loop in several different places and am

[PHP] Logic problem

2004-04-20 Thread Alex Hogan
Hi All, I am having a logic problem. (insert jokes here) I am trying to create a function that will allow me to pass any number of fields and tables into a blanket query. I am getting an error; Unexpected foreach. I have tried placing the loop in several different places and am getting the same

[PHP] logic for displaying hierarchical data (ala windows explorer)

2003-12-15 Thread Chris W. Parker
Hi everyone, Last Friday I struggled for a long time with displaying some data that's stored using the Modified Preorder Tree Traversal method. Without making this email overly long and complicated (like my first draft was) I'd like to simply ask if someone has any links or functions or instructio

Re: [PHP] MySQL query/PHP logic?

2003-07-29 Thread Jim Lucas
d'])) echo "found"; etc... } You get my point, but the big part is the select * <-- part of the sql call you have to identify each column that you want back with an alias otherwise they stomp all over one another. Jim Lucas - Original Message - From: "Petre A

Re: [PHP] MySQL query/PHP logic?

2003-07-29 Thread Nicholas Robinson
Don't know whether it's just because it's late at night here in the UK or whether I'm being a bit dim, but wouldn't it be much, much easier to store all the data in your non-main tables in a single table and distinguish the type of data (i.e. fof, pub, gov, etc) by a field. This would simpli

RE: [PHP] MySQL query/PHP logic?

2003-07-29 Thread Jennifer Goodie
> select * from main > left join fof on main.id = fof.id > left join pub on main.id = pub.id > left join gov on main.id = gov.id > left join med on main.id = med.id > left join ngo on main.id = ngo.id > left join ow

[PHP] MySQL query/PHP logic?

2003-07-29 Thread Petre Agenbag
Hi List OK, I've posted this on the MySQL list as well, but it seems a bit quiet there, and arguably it could definately be a PHP rather than mysql question depending on whether it can be done with one query (then it was/is a mysql query), or whether it should be done with some structures and mult

RE: [PHP] Logic headache, please help.

2002-11-11 Thread Marco Tabini
Crockford wrote: > > > > > > -Original Message- > > From: Marco Tabini [mailto:marcot@;tabini.ca] > > Sent: 11 November 2002 14:46 > > To: Tony Crockford > > Cc: Php-General@Lists. Php. Net > > Subject: Re: [PHP] Logic headache, please help. &g

RE: [PHP] Logic headache, please help.

2002-11-11 Thread Tony Crockford
> -Original Message- > From: Marco Tabini [mailto:marcot@;tabini.ca] > Sent: 11 November 2002 14:46 > To: Tony Crockford > Cc: Php-General@Lists. Php. Net > Subject: Re: [PHP] Logic headache, please help. > > > How about building an array of all the levels

Re: [PHP] Logic headache, please help.

2002-11-11 Thread Marco Tabini
How about building an array of all the levels: $a = array(); for ($i = 1; $i <= $maxlevels; $i++) $a[] = $i; then for each level you can create a new array that is the difference between the original array and an array that contains the current level: for ($i = 1; $i <= $maxlevels; $i++

[PHP] Logic headache, please help.

2002-11-11 Thread Tony Crockford
Hi all, brief explanation: I'm building a select list, to exclude certain directories from a search (with Ht://dig). The structure is like this: All levels Level 1 Level 2 Level 3 Level 4 for four levels, where the option value should be all lv's except the current option level. I have a var

[PHP] logic question

2002-06-09 Thread Justin French
Hi, I'm working on a message board. Everything is working fine, except some of the beta testers have requested the desire to have a "6 new replies" type system, so that they can easily recognise threads with new posts. The board is open to both guests (email) and users (userid), and the plan wo

Re: [PHP] Logic -- conditional statements

2002-06-04 Thread Analysis & Solutions
On Tue, Jun 04, 2002 at 04:40:26AM +0400, Ricardo Fitzgerald wrote: > > I'm trying to echo a neat table I've GOT to bust your chops. That table and your code are anything BUT neat. For neat, you need to put tags to close each cell. Also nest your code properly... if ($value2 ==0) {

RE: [PHP] Logic -- conditional statements

2002-06-04 Thread John Holmes
, but it's a better solution than all of the IFs that was just posted... ---John Holmes... > -Original Message- > From: Naintara Jain [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 04, 2002 5:47 PM > To: Ricardo Fitzgerald > Cc: Php-General@Lists. Php. Net &

FW: [PHP] Logic -- conditional statements

2002-06-04 Thread Naintara Jain
IL PROTECTED] [mailto:[EMAIL PROTECTED] t]On Behalf Of Naintara Jain Sent: Tuesday, June 04, 2002 2:37 PM To: Ricardo Fitzgerald; [EMAIL PROTECTED] Subject: RE: [PHP] Logic -- conditional statements The problem here is that you have defined three different variables $value1,$value2,$value3. Keep only

RE: [PHP] Logic -- conditional statements

2002-06-04 Thread Naintara Jain
ECTED] [mailto:[EMAIL PROTECTED] t]On Behalf Of Ricardo Fitzgerald Sent: Friday, July 10, 2893 3:44 PM To: [EMAIL PROTECTED] Subject: [PHP] Logic -- conditional statements Hi to all, I'm trying to echo a neat table with values from a form, depending on the values it echoes a table with one row with

[PHP] Logic -- conditional statements

2002-06-04 Thread Ricardo Fitzgerald
Hi to all, I'm trying to echo a neat table with values from a form, depending on the values it echoes a table with one row with two or with three: Then I have conditional nested statements, to validate these variables and wrote the table with the proper values in each case, the problem is the tab

Re: [PHP] Logic

2001-12-04 Thread Steve Werby
"Dan McCullough" <[EMAIL PROTECTED]> wrote: > Question. I am trying to check to see if a certain piece of code should be run. Here is an > example. > if ($type != "add") || ($type != "edit") || ($type != "delete") {//if this or this or this then > then run this code As pointed out, your paranth

RE: [PHP] Logic

2001-12-04 Thread Martin Towell
now change || to && and see if that does the job -Original Message- From: Dan McCullough [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 12:57 PM To: PHP General List Cc: Richard S. Crawford Subject: Re: [PHP] Logic that didnt work,i started off with if ($type

Re: [PHP] Logic

2001-12-04 Thread Dan McCullough
that didnt work,i started off with if ($type != "add") { that works } else { this works } I have done this before I'm just having a brain cramp. if (($type != "add") || ($type != "edit") || ($type != "delete")) { print $subcat_output; } else { print "Back to List of Subcategories"; } ---

Re: [PHP] Logic

2001-12-04 Thread Richard S. Crawford
You need parentheses around the entire antecedent: if (($type !="add") || ($type !="edit") || ($type !="delete")) { //etc ^--- Note these parentheses---^ Hope that helps. At 05:28 PM 12/4/2001, Dan McCullough wrote: >Question. I am trying to check to see if a

[PHP] Logic

2001-12-04 Thread Dan McCullough
Question. I am trying to check to see if a certain piece of code should be run. Here is an example. if ($type != "add") || ($type != "edit") || ($type != "delete") {//if this or this or this then then run this code } else { then run this } Is this correct, for some reason this isn't working

[PHP] Logic/method question...

2001-10-22 Thread Jeff Lewis
It's not really, but kind of, a PHP question. I mean it is being written in PHP :) I am putting together a search feature for our classified ads and there are about 4000 each day. Now I am bulding a query to search by newspaper, date, and keywords. One last thing is categories. Curious how

Re: [PHP]logic question

2001-07-22 Thread rm
try: http://php.resourceindex.com/Complete_Scripts/Link_Management/ you should be able to find some examples here. __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP Ge

[PHP]logic question

2001-07-22 Thread Chris Cocuzzo
hey- I'm in the process of writing a links page for a website. I want to have all the links seperated by category, and those categories would be placed in different columns. This means also that different categories of links could be on the same row in the table used to lay it all out. i'm pullin

[PHP] logic question concerning sale prices in shopping basket app

2001-02-28 Thread Brett
I have a simple page that offers three items(7700,7701,7702). I am trying to figure the best way to calculate the price for each shirt depending on the amount they want. The breakdown of prices is: Any 3 shirts for $50 7700 - 3 for $33 or $14.99 7701 & 7702 - 3 for $50 or $25. So I sort throu