Jump to content

Popeye

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

About Popeye

  • Birthday 08/05/1956

Contact Methods

  • Website URL
    http://www.gobombala.com
  • Yahoo
    popeye999dragon

Profile Information

  • Gender
    Not Telling
  • Location
    Bombala Australia

Popeye's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi All. This is what I came up with: [code]        $i = '1';         while($i <= ($num_of_rows ))            {                           while(list( $name, $value) = mysql_fetch_row($result) )                          {                                $value2 = $value;                                eregi("(^Guest?)([0-9]?[0-9]?)", $value, $msg);                                $newvalue .= $msg[2]." ";                                }                  $i = $i + 1;               };         $newi = '0';             $newcount = '';             $newvalue =$newvalue;             while($newi <= $num_of_rows)                  {                      if(eregi($newi,$newvalue ))                          {                                                        }else                          {                              $newcount .= $newi." ";                          }                      $newi++;                  }                  print "NewValue (Numbers used already) is ".$newvalue."<br>";                  print("NEWCOUNT (Numbers left) ".$newcount."<BR>");                  $newuser = explode(" ",$newcount, 3);                  print("NewUser is Guest".$newuser[0]);[/code] As I live in the "Bush" and teach myself, there is probably a better (neater) way to do this. I would welcome all "nit picking" and suggestions on whats wrong and how to improve it. Regards Popeye
  2. Thanks for the quick reply. I did think of adding a new table just to keep track off the Guests. But at the time I thought it seemed easier to use php? Then again we all know what thought did, hey :) The last time I messed with a xoops DB I broke it. Perhaps tomorrow I'll be thinking clearer. Popeye
  3. Hi All, thanks for looking! I need an answer for this, please. In a sql table I add the name Guest + a number 0 -9 so it would be Guest3 for example, or even just Guest. I need to sort the returned data so if, say, Guest 2 has left, that number can be reused? I have put a day into this one, and all I worked out is its harder than it looks. This gets Guestx but not Guest? eregi("(^Guest?)([0-9]?)", $value2, $msg); And then I cant think of a loop that will give the next available number? I had a few tries but none work reliably. Any Ideas? Thanks Popeye.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.