doctorbill
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>; } ?>
-------------------------- ---------- ---------- ------
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
<?php if ($row_unpaid['Paid'] == "Pending") {
echo <td colspan="12" align="center" class="body_bold_black"><a
--------------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If I run your statement the page is still blank
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get this:
Notice: Undefined variable: details in C:\xampp\htdocs\TickTock_i nt\invoice Database_p ending.php on line 470
Notice: Undefined variable: details in C:\xampp\htdocs\TickTock_i
ASKER
Thanks Ray - this has sorted it for me
I did not have a variable correctly referenced
I did not have a variable correctly referenced
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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>
--------------------------
$heading = 'Invoice Database (Unpaid)';
$paidheading = 'Invoice Database (paid)';
<td colspan="12" align="center" class="body_bold_black"><a
<?php if ($row_Unpaid['Paid'] == "Paid") {
echo $heading; } ?>
<?php if ($row_Unpaid['Paid'] == "Pending") {
echo $paidheading; } ?></td>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
ASKER
The page is just blank