Solved

IF statement php

Posted on 2015-02-07
4
165 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
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now