bubblegum.anarchy
Members-
Posts
526 -
Joined
-
Last visited
Never
Everything posted by bubblegum.anarchy
-
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
-
change WHERE NOT EXISTS to WHERE EMPLOYEE_NO NOT IN
-
Probably not.
-
Help On Invalid Default Value Error
bubblegum.anarchy replied to scott botkins's topic in MySQL Help
change DEFAULT '""' to DEFAULT NULL or DEFAULT '' -
SELECT * FROM table_name WHERE cast(column_name AS CHAR) LIKE 'search_term'
-
Have you tried the Installation and Configuration Forum: http://www.phpfreaks.com/forums/index.php/board,63.0.html ?
-
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.
-
Problems with having part of the date ignored
bubblegum.anarchy replied to ClassicNancy's topic in MySQL Help
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. -
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.
-
Problems with having part of the date ignored
bubblegum.anarchy replied to ClassicNancy's topic in MySQL Help
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? -
Have you re-checked the website... the issue may have been since resolved and the reason your friend has no problems with the website.
-
There is nothing you can personally do to resolve the websites error but information the proprietor of the website.
-
Problems with having part of the date ignored
bubblegum.anarchy replied to ClassicNancy's topic in MySQL Help
And what do you want? -
[SOLVED] order by ... 2 queries involved..
bubblegum.anarchy replied to immanuelx2's topic in MySQL Help
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 -
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.
-
I'm trying to create a CronJob to update a database table.
bubblegum.anarchy replied to toasty's topic in MySQL Help
Read the following page: http://www.ss64.com/bash/crontab.html -
Triggers in MySQL version >= 5.0 : http://dev.mysql.com/doc/refman/5.0/en/triggers.html Triggers can insert a clone record.
-
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
-
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.
-
SELECT IF (version() >= 5.0, Stored Procedures and Functions, google)
-
[SOLVED] mysql secondary "order by"?
bubblegum.anarchy replied to tommyboy123x's topic in MySQL Help
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 -
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...
-
My money is on a wayward quote.... ... mysql_real_escape_string()