Avatar of doctorbill
doctorbill
Flag for United Kingdom of Great Britain and Northern Ireland asked on

PHP code IF

This code causes my page to be blank
The correct SQL statements and database connections are in place:

----------------------------------------------------

<?php if ($row_unpaid['Paid'] == "Paid") {
                    echo <td colspan="12" align="center" class="body_bold_black"><a name="paid" id="paid"></a>Invoice Database (paid)</td>;  } ?>

 <?php if ($row_unpaid['Paid'] == "Pending") {
                    echo <td colspan="12" align="center" class="body_bold_black"><a name="unpaid" id="unpaid"></a>Invoice Database (Unpaid)</td>; } ?>

----------------------------------------------------
PHP

Avatar of undefined
Last Comment
doctorbill

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Julian Hansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
doctorbill

ASKER
No error
The page is just blank
doctorbill

ASKER
If I run your statement the page is still blank
SOLUTION
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
doctorbill

ASKER
I get this:

Notice: Undefined variable: details in C:\xampp\htdocs\TickTock_int\invoiceDatabase_pending.php on line 470
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
doctorbill

ASKER
Thanks Ray - this has sorted it for me
I did not have a variable correctly referenced
SOLUTION
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
doctorbill

ASKER
This is now working:
------------------------------------------------------
$heading = 'Invoice Database (Unpaid)';
$paidheading = 'Invoice Database (paid)';


<td colspan="12" align="center" class="body_bold_black"><a name="unpaid" id="unpaid"></a>
 <?php if ($row_Unpaid['Paid'] == "Paid") {
                    echo $heading;  } ?>
               <?php if ($row_Unpaid['Paid'] == "Pending") {
                    echo $paidheading;  } ?></td>
SOLUTION
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
doctorbill

ASKER
thanks
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.