Link to home
Start Free TrialLog in
Avatar of doctorbill
doctorbillFlag 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>; } ?>

----------------------------------------------------
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of doctorbill

ASKER

No error
The page is just blank
If I run your statement the page is still blank
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I get this:

Notice: Undefined variable: details in C:\xampp\htdocs\TickTock_int\invoiceDatabase_pending.php on line 470
Thanks Ray - this has sorted it for me
I did not have a variable correctly referenced
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks