Jump to content

bubblegum.anarchy

Members
  • Posts

    526
  • Joined

  • Last visited

    Never

Posts posted by bubblegum.anarchy

  1. This following query might help guide you in the right direction:

     

    SELECT user_name
         , user_birthday
         , CURRENT_DATE
         , IF (date_format(user_birthday, concat(year(CURRENT_DATE), '-%m-%d')) >= CURRENT_DATE
              , date_format(user_birthday, concat(year(CURRENT_DATE), '-%m-%d'))
              , date_format(user_birthday, concat(year(CURRENT_DATE + INTERVAL 1 YEAR), '-%m-%d'))) AS next_birthday
    FROM wowbb_users
    ORDER BY next_birthday
    

     

    The above query lists all the user names, the current date and the users upcoming birthday date, there is just a matter of adding an appropriate WHERE clause to limit the records where the next_birthday is within a week.

  2. There could be some issue with your account record... have your friend pass on the website contact details and get in touch with them - provide as much detail as possible, as in your computer and browser, and of course the error message.

  3. Consider creating a global function to grab the result set, that is accessible to the entire website (or where applicable):

     

    function player_name_result()
    {
         static $result;
    
         if (!isset($result))
         {
              mysql_query($query = "
                   SELECT * 
                   FROM appearances
                   ORDER BY team_id") or trigger_error(mysql_error()."<PRE>".$query."</PRE>", E_USER_ERROR);
         }
    
         return $result;
    }
    

     

    The above query would obviously have to be more appropriate... then the function can be called from within the html like this:

     

    <SELECT class="MyClass" id="player_one" name="player_one"
         <OPTION value="0">Select Player</OPTION>
         <? while ($record = mysql_fetch_assoc(player_name_result())):?>
              <OPTION value="<?=$record['player_one'];?>"<? if ($record['player_one'] == $selected['player_one']):?> selected<? endif;?>></OPTION><? endwhile;?>
    </SELECT>
    

     

    The above syntax has not been validated.

  4. Use mysql_real_escape_string() and then quote your variables before database insertion so that the final insert string looks more like this:

     

    UPDATE pages SET page_description='A great homepage for anyone living in Australia\'s Blue Mountains',page_keywords='search engine blue mountains' WHERE page_id=1

     

  5. oops - you would not... sorry... I was mixing regular expression and MySQL LIKE.

     

    well... the issue would then be in the amount of time taken to create a joins to employee and employer tables.

     

    The combined id method requires that the ids be extracted before joins are created where as keeping id seperate does not.

  6. There would be an issue with searching against the employer ID since LIKE '%{$employer_ID}' would return more than expected.

     

    Normally, linked tables are structured this way:

     

    message.id

    message.employer_id

    message.employee_id

    message.content

    etc...

     

    That is if employee to employee or employer to employer messages are not allowed, otherwise:

     

    message.id

    message.author_id

    message.recipient.id

    message.content

    etc...

×
×
  • 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.