If statement not working
Posted: Tue Mar 13, 2012 6:44 pm
I'm attempting rather unsuccessfully to conditionally insert a form action based on a value from a field in my query.
If the value of Trap = "Edit" I want to point the page to the edit record page, else send it to an add record page.
note,
displays either the text "Edit" or "Create" based on whether a record for that month's report already exists or not.
$FName always echos: ReportMonthlyAdd.php
Could someone tell me what I'm screwing up?
Thanks,
Betty (php newby)
If the value of Trap = "Edit" I want to point the page to the edit record page, else send it to an add record page.
note,
Code: Select all
<?php echo $row_RS_ProjReports['Trap'] ?> Code: Select all
<?php
$FName = NULL;
if ($row_RS_ProjReports['Trap']="Edit") {
$FName = "ReportMonthlyEdit.php"; } {
$FName = "ReportMonthlyAdd.php"; }?>
Could someone tell me what I'm screwing up?
Thanks,
Betty (php newby)