Sponsored Content
Full Discussion: IF && statement problem
Top Forums Programming IF && statement problem Post 302496818 by apmcd47 on Tuesday 15th of February 2011 10:53:00 AM
Old 02-15-2011
I suspect you can't do
Code:
if (expr) bool (expr)

in php. Try the following instead:
Code:
if (($session['cid'] == 2) && (($item['type'] == DAGGER) && ($item2['type'] == DAGGER)) || 
    (($item['type'] == FIST WEAPON) && ($item2['type']== FIST WEAPON)))

Andrew
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem w/ -z && -n switches in an if statment

When ever i run this if statement with the -n OR -z switches it always returns says positive and does "HAVE STUFF". BUT the file does not contain the word optimus in any form. $echo this is mojo > test.file $if ; then >echo HAVE STUFF >else^Jecho NO STUFF >fi HAVE STUFF $if ; then... (1 Reply)
Discussion started by: Optimus_P
1 Replies

2. Shell Programming and Scripting

if statement with two conditions -e, &&

Wow I'm so zoned out I don't even know if I posted this question up already (I couldn't find it in my book marks or in "yesterday's" post). My question is, I'm writing a korn script that does something like the following, but I don't yet completely understand the syntax. I need to check that... (16 Replies)
Discussion started by: yongho
16 Replies

3. Shell Programming and Scripting

using && in if statement ..

Hi All, Can some one tell me how to get run the following: data1="hello" data2="world" if then { echo "good afternnon" } else { echo " good morning" } fi The above code gives me an error ad below : ./if.h: line 3: ' (7 Replies)
Discussion started by: jisha
7 Replies

4. UNIX for Dummies Questions & Answers

Problem with xterm & tcsh & sourcing a script in a single command

Hi friends, I have a script that sets the env variable path based on different conditions. Now the new path variable setting should not done in the same terminal or same shell. Only a new terminal or new shell should have the new path env variable set. I am able to do this only as follows: >cd... (1 Reply)
Discussion started by: sowmya005
1 Replies

5. Shell Programming and Scripting

PHP read large string & split in multidimensional arrays & assign fieldnames & write into MYSQL

Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP. I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Discussion started by: lowmaster
0 Replies

6. Shell Programming and Scripting

Problem with call of Java Programm & return code handling & output to several streams.

Hello Everybody, thanks in advance for spending some time in my problem. My problem is this: I want to call a java-Programm out of my shell skript, check if die return code is right, and split the output to the normal output and into a file. The following code doesn't work right, because in... (2 Replies)
Discussion started by: danifunny
2 Replies

7. Shell Programming and Scripting

How to write If statement using && and operator in Unix

Hi What is the syntax for if statement using && and || operator? if && ] || here its giving me an error to this if statement any suggestion?? (2 Replies)
Discussion started by: Avi
2 Replies

8. Shell Programming and Scripting

if statement with '&&' gives error

Hi, I'm using the && operator in if statement: if ; then exp $UID/$PWD@$ORACLE_SID FILE=./DUMP/$TODAY$CONCAT_STR$USERNAME.dmp STATISTICS=NONE LOG=./LOG/$TODAY$CONCAT_STR$USERNAME.log elif ; then expdp $UID/$PWD@$ORACLE_SID DIRECTORY=./DUMP/ DUMPFILE=$TODAY$CONCAT_STR$USERNAME.dmp... (8 Replies)
Discussion started by: priya001
8 Replies

9. Shell Programming and Scripting

Using && in if statement with 3 expressions

how do you write an if statement for something like if ((expr 1 >= expr 2 && expr 3 >= expr 4) && expr 5 <= expr 6) if ((TRUE && TRUE) && TRUE) then condition... i've done it this way but it doesn't seem to work. if (] && "$ex_day" -le "$curr_day" ); then condition... (3 Replies)
Discussion started by: angilulu
3 Replies

10. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies
widget_toolbar(n)					    widget::toolbar Megawidget						 widget_toolbar(n)

__________________________________________________________________________________________________________________________________________________

NAME
widget_toolbar - widget::toolbar Megawidget SYNOPSIS
package require Tcl 8.4 package require Tk 8.4 package require widget ?3.0? package require widget::toolbar ?1.0? widget::toolbar pathname ?options? getframe add ?item? ?args? delete item1 ?item2? ?...? itemcget symbol option itemconfigure symbol ?args? items ?pattern? remove ?-destroy? item1 ?item2? ?...? _________________________________________________________________ DESCRIPTION
This package provides a toolbar megawidget (snidget). It makes use of the Tile/Ttk themed widget set. widget::toolbar pathname ?options? getframe add ?item? ?args? delete item1 ?item2? ?...? itemcget symbol option itemconfigure symbol ?args? items ?pattern? remove ?-destroy? item1 ?item2? ?...? WIDGET OPTIONS
-ipad -pad -separator ITEM OPTIONS
-pad -separator -sticky -weight EXAMPLE
package require widget::toolbar ; # or widget::all set t [widget::toolbar .t] pack $t -fill x -expand 1 $t add button [button .b -text foo] $t add separator -pad {2 4} $t add button [button .c -text bar] KEYWORDS
megawidget, snit, widget widget 3.0 widget_toolbar(n)
All times are GMT -4. The time now is 06:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy