close ad
 
Important WebAssist Announcement
open ad
View Menu

Web development tutorial

PHP hide field if empty MYSQL to MYSQLi

Tutorial created by The Flying Fox, Blue Heaven Designs

Categories: Data Bridge, MySQLi Server Behaviors, MySQL, PHP

rating

Updating you MYSQL to MYSQLi

Creating hidden fields based on empty recordset fields

arrow downPHP hide field if empty

If you have updated to MYSQLi, you have made a wise decision.

But some of your code doesn't work, don't fret, there is always an answer

Step 1: changing hidden field from MYSQL to MYSQLi

You have hidden fields based on your recordset
Some fields are empty but you need to show the rest of the data. No worries

Your code should look like the following code:-

*** MYSQL CODING ***
<?php if($row_recordsetName['columnName'] != "") { ?>
your data to be shown if field is populated
<?php } ?>

Just replace the first line of your code with the following:-

*** MYSQLi CODING ***
<?php if($recordsetName->getColumnVal("columnName") != "") {?>

It's as easy as that.

Andy

arrow downReviews and comments

Comments will be sent to the author of this tutorial and may not be answered immediately. For general help from WebAssist, please visit technical support.

Sign in to add comments
rating

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.