Jump to content


  • Posts

  • Joined

  • Last visited


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
  3. change DEFAULT '""' to DEFAULT NULL or DEFAULT ''
  4. SELECT * FROM table_name WHERE cast(column_name AS CHAR) LIKE 'search_term'
  5. Have you tried the Installation and Configuration Forum: http://www.phpfreaks.com/forums/index.php/board,63.0.html ?
  6. 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.
  7. 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.
  8. 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.
  9. 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?
  10. Have you re-checked the website... the issue may have been since resolved and the reason your friend has no problems with the website.
  11. There is nothing you can personally do to resolve the websites error but information the proprietor of the website.
  12. 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
  13. 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.
  14. Read the following page: http://www.ss64.com/bash/crontab.html
  15. $query = "SELECT DISTINCT `pet_id`, COUNT(`pet_id`) AS amount FROM `read2` GROUP BY `pet_id` AND ORDER BY `pet_id` ASC";
  16. Triggers in MySQL version >= 5.0 : http://dev.mysql.com/doc/refman/5.0/en/triggers.html Triggers can insert a clone record.
  17. 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
  18. 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.
  19. SELECT IF (version() >= 5.0, Stored Procedures and Functions, google)
  20. 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
  21. 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...
  22. 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.