Jump to content

bubblegum.anarchy

Members
  • Posts

    526
  • Joined

  • Last visited

    Never

Everything posted by bubblegum.anarchy

  1. Read this: http://dev.mysql.com/doc/refman/4.1/en/join.html and then Read the ORDER BY information here: http://dev.mysql.com/doc/refman/4.1/en/select.html
  2. how so?
  3. change WHERE NOT EXISTS to WHERE EMPLOYEE_NO NOT IN
  4. Probably not.
  5. change DEFAULT '""' to DEFAULT NULL or DEFAULT ''
  6. SELECT * FROM table_name WHERE cast(column_name AS CHAR) LIKE 'search_term'
  7. Have you tried the Installation and Configuration Forum: http://www.phpfreaks.com/forums/index.php/board,63.0.html ?
  8. What does your version of player_name_result() return? - keep in mind that my version returned a result id used with mysql_fetch_assoc() and not an array.
  9. 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.
  10. 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.
  11. Where does it read the year in the profile code? Do you want the get_birthdays() function to return a list of stored birthdays irrespective of the birthday year?
  12. Have you re-checked the website... the issue may have been since resolved and the reason your friend has no problems with the website.
  13. There is nothing you can personally do to resolve the websites error but information the proprietor of the website.
  14. SELECT groups.id, groups.name, count(members.id) AS member_count FROM groups LEFT JOIN members ON groups.id = members.group_id GROUP BY groups.id ORDER BY member_count DESC
  15. 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.
  16. Read the following page: http://www.ss64.com/bash/crontab.html
  17. $query = "SELECT DISTINCT `pet_id`, COUNT(`pet_id`) AS amount FROM `read2` GROUP BY `pet_id` AND ORDER BY `pet_id` ASC";
  18. Triggers in MySQL version >= 5.0 : http://dev.mysql.com/doc/refman/5.0/en/triggers.html Triggers can insert a clone record.
  19. 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
  20. 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.
  21. SELECT IF (version() >= 5.0, Stored Procedures and Functions, google)
  22. Replace the AND with a comma, sort order direction can also be applied to each sorted column such as: SELECT * FROM search ORDER BY topic DESC, name ASC
  23. 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...
  24. My money is on a wayward quote.... ... mysql_real_escape_string()
×
×
  • 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.