Solved

IF statement php

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

808 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