create a repeat region that ignores records where name field is empty in PHP

Posted on 2011-10-31
Last Modified: 2012-06-27
Just a quick question I'm stuck on.

I would like to create a repeat region that will only display records that contain a name in the name field of the 'comments' table.

If the name field is empty, I want the record to be excluded from the repeat region.

Any help would be appreciated.

Question by:SaigonJeff
    LVL 13

    Accepted Solution

    something like this ?
    if ($row['comments']!=""){
    echo "<tr><td>".$row[name] ......";
    LVL 13

    Assisted Solution

    or a  better comparisson in case you want to show comments that are larger than x chars
    if (strlen($row[comments])>x chars ){
    LVL 5

    Expert Comment

    please post the code here.
    LVL 5

    Author Closing Comment

    I have found a free extension which seems to do the job.

    It is a simulated nested region extension by Tom Muck

    It works well .

    Thank for everyone's assistance

    In fairness, I have awarded points to both solutions offered.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to count occurrences of each item in an array.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now