Solved

IF statement php

Posted on 2015-02-07
4
185 Views
Last Modified: 2015-02-07
Can someone please tell me how to rewrite this statement so that it represents a value:

<?php if (!empty($row_artGallery[artgal_fsize])

example:
<?php if ($row_artGallery[artgal_fsize]) = "cm"
0
Comment
Question by:doctorbill
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 250 total points
ID: 40595882
Comparison in PHP is the double equals, and the whole IF statement should be wrapped in parenthesis

<?php if ($row_artGallery['artgal_fsize'] == "cm") {
...
}

Open in new window

0
 
LVL 10

Assisted Solution

by:aboo_s
aboo_s earned 250 total points
ID: 40595886
<?php if ($row_artGallery[artgal_fsize] .src=="/images/flower.jpg") echo "found!";
0
 

Author Comment

by:doctorbill
ID: 40595907
perfect - thanks
0
 

Author Closing Comment

by:doctorbill
ID: 40595910
solution
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question