mikosiko
Members-
Posts
1,327 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mikosiko
-
try this: SELECT u.userid,u.username,SUM(t.active),SUM(t.idle) FROM users AS u LEFT JOIN onlinetime AS t ON u.userid=t.userid WHERE u.activitycount = 0 GROUP BY u.userid HAVING SUM(t.active) < 100
-
did you look in the "FAQ/Code Snippet Repository" folder? (in the main page of this site)?.... there are a few examples
-
try to find the mysql config file in your old server and look at it... I will start from there... error seems to point to that server is not accepting remote connections
-
google "phpinfo security" this is a related funny post.... and serious too http://www.eschrade.com/page/google-searches-4c067780
-
I just don t see how to link fileds of one table to another table
mikosiko replied to franklos's topic in MySQL Help
first... you should modify your table composers... look your current definition and thinks about it.... one composer can compose multiples pieces right?... how your current table can manage that ? ... you should take out to another table the columns "name of composition" and "publisher id" and establish the relation between the composers table and this new table. -
what is the name of the file that you searched for?
-
check in your OLD server the mysql cnf file (normally under /etc/mysql if linux server) if it has the directive skip-networking active... if so you can comment it .... restart mysql and try
-
for your knowledge..... you ARE using JOINS.... only difference is you are using "Implicit JOINS" all those xxx = yyy ARE implicit joins
-
explain the purpose of your point_list table please... and test this (no tested in my side... the SUM(c.POINT_RESULT) could be incorrect depending on the meaning of your table point_list) SELECT b.Club_ID, SUM(c.POINT_RESULT) AS TPoints FROM match2players a JOIN player2club b ON a.P2C_ID = b.p2c_id JOIN point_list c ON a.points = c.points JOIN match2tournamet d ON a.m2t_id = d.m2t_id WHERE d.tourn_id = $tournamentid GROUP by b.Club_ID ORDER BY TPoints DESC
-
complementing my previous answer... you should look for the usage of mysql_field_name() and use it in the previous explained context. http://php.net/manual/en/function.mysql-field-name.php hope this help.
-
your objective no make sense ... you should think again about your goal ... and think based on how SQL works... apparently what you want is select all the records where user_id = 5 and then you can choose to show or not the fields if the value = 1 (the name of the field is irrelevant because you can alter it every time you want (aliasing) ).
-
you want the "FIELD NAMES" ?.... based on a condition where you are already using some of the field names?.... no make any sense.... maybe you are trying to get all the rows (values) where the condition is TRUE ?... post your table description
-
Is it possible to search one table while using another as a condition?
mikosiko replied to pault's topic in MySQL Help
most likely possible... post the code that you are using for that.... and additional your table's definitions a simple join should solve your issue if your table design is correct. -
While looped insert is not working as expected. No errors.
mikosiko replied to OldWest's topic in PHP Coding Help
$insert_city_query = "INSERT INTO sys_city_dev (ID, Mid, cityName, forder, disdplay, cid) VALUES (' ','" . $mid_id . "','" . $rows['city_name'] . "', '', '','')"; if (!$insert_city_query) exit(mysql_error()); } I don't see how record will be inserted.... mysql_query($insert_city_query) is not there -
Error is due to that you are selecting more than 1 column in your sub-queries... that is not allowed in that context.
-
my friend.... you have some spaces where you don't have to (note the spaces after SUM... those are wrong).. and you need spaces in others places (before FROM and ORDER) try: SELECT SUM( IF ( comments = 'pass', 1, 0 ) ) AS withComments, SUM(1) AS total FROM dsgi_serval ORDER BY SUM( IF ( comments = 'pass', 1, 0 ) ) DESC; and even when that statement is correct, I personally I will write it like this, considering that you want to have those counts grouped by make (as you posted in your first SQL): SELECT make, COUNT(*) AS total, SUM(IF(comments = 'pass', 1, 0)) AS withComments FROM dsgi_serval GROUP BY make ORDER BY COUNT(*) DESC; notice that for "total" I did use COUNT only because SUM and COUNT perform a little different... but both will have the same results for that specific field
-
post the sentence that was giving to you by Dan showing exactly how you have it right now (the one that is giving you errors)....
-
post the complete sentence that you have now
-
funny... but is ok... this: AS withComments, is not the same as:
-
mysql_query "CREATE DATABASE IF NOT EXISTS"
mikosiko replied to The Little Guy's topic in PHP Coding Help
then mysql_query is going to produce an error.... no -
gotcha... but that has nothing to do with MYSQl manual functionality.... Adobe is the one to blame I do use PDF-Xchange viewer since long time ago.... give it a try... is way faster than Adobe
-
what kind of problem do you have with the pdf format?.... I have that and it work perfectly for me.. Index/bookmark/format everything looks ok to me
-
absolutely... using your example: SELECT count(anything) FROM yourtable WHERE thisCol NOT IN ('enter', 'start', 'zero') GROUP BY whatever
-
- How many records do you have in your dbase and letters tables? - There are indexes defined for both tables? (dbase.id and letters.maindatabaseid) - Did you run an EXPLAIN over your select to detect what is happening?