php if

Code trial 1:
------------------
$img_path = 'ticktockInt/images/jpg/exclaim.jpg';  

<tr>
           
<td colspan="12" align="center" class="body_bold_black"><a name="remimage" id="remimage"></a>
 <?php if ($row_invoicesReminders['Reminder'] == "Remind") {
                    echo "<li><img src='$img_path;'/><li>";  } ?>
               

       </tr>
        <tr>

Code trial 2:
------------------

$img_path = '<img src="ticktockInt/images/jpg/exclaim.jpg" width="102" height="102" />';

<td>
             
               <?php if ($row_invoicesReminders['Reminder'] == "Remind") {
                    echo $img_path;  } ?></td>
            </tr>


I do not get any errors
doctorbillTechAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Marco GasiFreelancerCommented:
Php is case-sensitive: are you sure the value should be 'Remind' and not 'remind'? And the same quetion can be done about the column name...
0
Marco GasiFreelancerCommented:
Can you show the whole code: query and loop?
0
doctorbillTechAuthor Commented:
<?php do { ?>
            <tr>
              <td align="left" valign="top" class="totals"><?php echo $row_invoicesReminders['ID']; ?></td>
              <td align="left" valign="top" class="totals"><?php echo $row_invoicesReminders['Name']; ?></td>
              <td align="left" valign="top" nowrap="nowrap" class="totals"><?php echo $row_invoicesReminders['Date']; ?></td><td>
             
               <?php if ($row_invoicesReminders['Reminder'] == "Remind") {
                    echo $img_path;  } ?></td>
            </tr>
            <?php } while ($row_invoicesReminders = mysql_fetch_assoc($invoicesReminders)); ?>
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Dave BaldwinFixer of ProblemsCommented:
I don't know why you think there should be errors but this line...

echo "<li><img src='$img_path;'/><li>";

needs to have the ';' after $img_path removed.

echo "<li><img src='$img_path'/><li>";
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Marco GasiFreelancerCommented:
Try this

if (trim($row_invoicesReminders['Reminder']) == "Remind")

Open in new window


Maybe there is some hidden space in your database column...
0
doctorbillTechAuthor Commented:
Dave:
If I just put this into the page:
echo "<img src='$img_path'/>";  } ?>

I get the inage
So it vlooks as if there is a problem with the IF statement
0
Marco GasiFreelancerCommented:
Did you try to use trim as I suggested above?
0
doctorbillTechAuthor Commented:
Sorted:
I edited my recordset - it was not referencing all the fields correctly (specifically thyhe "Reminders" field
0
doctorbillTechAuthor Commented:
completed
0
Marco GasiFreelancerCommented:
What is the solution? Editing the recordset (and how?) or deleting a semicolon? I'm missing something here...
0
Ray PaseurCommented:
Going forward, a useful concept in PHP programming is the use of HEREDOC notation to make templates and HTML fragments that are later used in creating a complete web page.  Once you know how this works, it will revolutionize your programming and design practices.  Just a thought...
http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
0
doctorbillTechAuthor Commented:
Marco:
The solution was to edit the recordset and get rid of the ";"
0
Marco GasiFreelancerCommented:
Thanks for the explanation :-)
0
doctorbillTechAuthor Commented:
Thanks Ray
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.