If else statement with null value in database and href to downloadable file

I am trying to check a field in my database to see if it is null. Right now that works and places the text that is in the field otherwise.

However, I need it to link to a zipped file for download if it is available in the database.

This is what I have tried but it says I have errors and I don’t know where they are.

<?php if ($row_rsDetails['Manuals'] == null) {echo 'Please click here and complete the online form. A technician will address your needs as soon as possible. Thank you.';} else {echo "Please click here to download the current manuals;} ?>

I appreciate any help.

Hi there,

I’ve fixed the errors in your code and you should now be fine:

[php]

<?php if($row_rsDetails['Manuals'] == null) { echo 'Please click here and complete the online form. A technician will address your needs as soon as possible. Thank you.'; } else { echo 'Please click here to download the current manuals'; } ?>

[/php]

Let me know if there’s anything else I can help you with.

Cheers!

Thank you for your help OpzMaster.

I pasted in the code below and Dreamweaver gives me an error in the lines with the if statement and the else statement. Not really sure what is wrong but it breaks the page.

I appreciate your help very much.

HI again,

I actually used Dreamweaver to fix your code and the code I gave to use shouldn’t have errors. Try running it on your webserver and see if there’s issues.

Cheers!

:smiley:
Thank you! I must have copied it incorrectly it works great. Have a wonderful week.

Sponsor our Newsletter | Privacy Policy | Terms of Service