Hide div if database contains value – Angular [closed] Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Hide div if database contains value – Angular [closed] without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I want to check if a MySQL database contains a specific value. If it is true I want to hide a HTML <div>. Is this possible?

Can I hide elements with CSS & JS, or what should I use to hide the div?

Also, How would we add it in the Div like a NgIF statement

Thanks!

Answer

Try something like this in your PHP file. I have included an example of an item that is always rendered, and something that is conditionally rendered.

<div id="userinfo">
    <?php // This is always rendered by the server ?>
    Username: <?php htmlentities($row['username']) ?>

    <?php // This is rendered by the server if the column is true ?>
    <?php if ($row['admin']): ?>
        <div class="admin">(admin)</div>
    <?php endif ?>
</div>
We are here to answer your question about Hide div if database contains value – Angular [closed] - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji