Using an empty function with a Foreach loop
P粉988025835
P粉988025835 2023-09-07 12:44:13
0
1
401

I want to output a message when there is no item in the database. this The code does not print statements when the database has no data.

This is my code,   


Tender Name: No advertised Tenders, Check again later.

P粉988025835
P粉988025835

reply all (1)
P粉283559033

Assuming$latest_tendersis your database result, first check if the$latest_tendersarray is not empty. If not empty: loop over$latest_tendersand print its$tenders. Otherwise (empty): print your error message.

   


Tender Name : No advertised Tenders for No, Check again later.

    Popular Topics
    More>
    Popular Articles
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!