Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 52
5 members and 47 guests
affiz4iliate6ec, cliaw9cckhereto, mariacolmanyne3, medaricalddw93g, parttarcts
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
» .:.

Go Back   Nukemods Forum > PHP-Nuke 7.x > Nuke 7.x - Modules

Reply
 
LinkBack Thread Tools Display Modes
no result from database, then show message
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 20
Join Date: Dec 2004
no result from database, then show message - 01-04-2005, 08:33 PM

When the code below is executed, it can happen that there was no result. When this happens i want to show the user a message that there were no items in the database to show for the upcomming period. How can i do that

Code:
   Opentable();
   $resultpersons = sql_query("SELECT * FROM ".$prefix."_probs_agenda WHERE Datum >= ".date("y-m-d")." ORDER BY Datum", 

$dbi);
   echo "<table border=1>";
   for ($m=0; $m < sql_num_rows($resultpersons, $dbi); $m++) {
Also, The date returned by mysql is in the format Year, Month, Day. I want this to be Day, Month Year. What do i have to do for that
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#2 (permalink))
Junior Member
 
Status: Offline
Posts: 20
Join Date: Dec 2004
01-05-2005, 04:28 AM

This is the solution. if it seems to be incorrect, please say so
Code:
   if (1 > sql_num_rows($resultpersons, $dbi)) {
      echo "Geen items gevonden";
   } else {
      for ($m=0; $m < sql_num_rows($resultpersons, $dbi); $m++) { 
         list($id, $datum, $tijd, $klantid, $description, $addby) = sql_fetch_row($resultpersons, $dbi);
         $resultname = sql_query("SELECT Naam, Voornaam FROM ".$prefix."_probs_klant WHERE id='$klantid'", $dbi);
         list($lastname, $firstname) = sql_fetch_row($resultname, $dbi);
      }
   }
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DATABASE, HOW DO I CONFIGURE MY DATABASE I SEE 3 OF THEM lhpnuke Site design 2 05-28-2006 06:08 PM
Site Registration result automtically to activate user zoch10 Nuke 7.x - General 0 07-17-2005 12:51 PM
Result on the forum with fiblack3d ERROR conens Theme packs 5 07-30-2004 09:53 AM
phpbb database converter to Nukemods database palooka Open topics 3 06-15-2003 10:57 AM
new: Splatt Forums database into your phpBB Forums database Martin Purged Topics 2 03-01-2003 07:47 PM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31