| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Comments:
<0> thank you <0> which is better? <0> adding binary or using varbinary? <1> there's also a way doing this at runtime, you'll lose indexing though <2> they're equivalent. I thik varbinary was added for compiance/compatibilty. <1> WHERE BINARY foo = 'bAr' <0> alright. thanks for your help <0> doing it in the table def will be best I think <0> goodbye <3> evil SpComb <3> fleas are evil <3> but ticks are worse <3> ticks are THE evil on earth <4> and tocks? <3> ahhh the tocks... <3> ph33r
<3> i've been coding 13 hours non-stop <3> this is sick <3> "credit cards MUST work tomorrow..." <3> gah <4> ooh, credit cards <4> like, make a cataloged database of credit card numbers? <5> can anyone here please help me with a select statement? <5> I'm a bit of a newbie I'm afraid <5> totally stuck at the mo <6> Moses, what are you trying to do? <5> I've posted in a forum about it just now, shall I post you the link? <5> hang on <5> http://www.phpfreaks.com/forums/index.php?showtopic=89975 <5> might make it easier <5> but basically, it's a fairly long join, well for a newbie like me it is anyway <5> I'm trying to create a league system for an online game...one where people can create their own leagues <5> and at the moment, I'm stuck when it comes to creating a select statement that will show me all the teams in a given league, as I can only get the teams that have been ***igned a user already <5> if that makes sense <6> Moses, whats your table structure? <5> well, I used a database designer program to create it <5> hang on, I'll take a screenshot and put it on imageshack <5> if that's ok? <6> Nah, actually don't need it; I have enough info at your forum post. <5> ah ok <5> I'm not sure if my table structure is right to be totally honest, although from looking at it I think it should work <5> well, if it helps anyway, you can see it here: http://img108.imageshack.us/img108/6240/database4gk.png <5> got any idea what I should be doing? <6> Ok so you want to grab all the league_id's inside of team_id ? <6> or the other way I mean <6> All the team_ids inside of league_id <6> Correct? <5> hang on let me look at it <5> yes <5> what I want though, is for the information to basically come out like this: "league position, team name, username, games played, games won, lost, drawn, goals scored, goals conceded, goal difference, points" <6> Yes. <5> but I need the same information to come out even when a team has no ***igned player <5> so if a player quits half way through a season for example, the team carries on with that many points etc until someone else takes over <6> SELECT team_id FROM teams AS a LEFT JOIN leagues AS b ON (a.league_id = b.id) see what that yields. <5> ok one sec <6> team_id should be team_name_id <6> b.id should be b.league_id <6> SELECT a.team_names_id FROM teams AS a LEFT JOIN leagues AS b ON (a.league_id = b.league_id) ; try that rather. <5> ok one sec <5> yes, that has outputted all the id fields for my teams names <5> well, I think for team names that have been ***igned leagues <6> with their league? <5> no, just the team id <6> SELECT a.league_id, a.team_names_id FROM teams AS a LEFT JOIN leagues AS b ON (a.league_id = b.league_id) <6> use that. <6> should be a list of [ league id ] [ team name ] <5> yes, that worked <5> but how do I bring it all together, or would I have to use more than one select statement? <7> can i have 2 primary keys in a table? <6> Moses, is the other information from other tables? <5> yes <6> Moses, then you will need to join the other tables, what is the exact output you want again? <5> I was using 5 tables overall I think <5> ok hang on <5> the output I need is like this: "league position, team name, username, games played, games won, drawn, lost, goals for, goals against, goal difference, points" <8> Hello <8> all
<7> moses > that yes was for me or you are not multitasking? :D <5> lol no sorry rogochin, I was talking to crazytux <2> anyone have any ideas about my phpMyAdmin issues? <6> Moses, haha, you're lucky I'm going to the gym, so I'm not opening up any of my projects to work on yet :D. Ok one sec, will give you query. <5> ok thanks tux, I really appreciate it :) <6> sure no problem. <6> Moses, how is league position going to be calculated? <5> ah, that will be in terms of points first, then goal difference, then goals scored <6> So the position will be more of an "ORDER BY" rather than an actual ranking # correct? <5> yeah, that's right <6> Ok. <9> how can I perform UPDATE `table` SET `field` = '1' WHERE `id` =12 LIMIT 1; but updating multiple fields at the same time? <9> in one qurey <8> i get error message 1045 in query browser when i try to mysql in local network... what is the solustion? <5> poker.. does this link help? http://www.techtricks.com/webstuff/mysql/error1045.php <6> Moses, I think your database structure could be set up a bit different, to make it more efficient. <5> really, how? <5> I dont know much about this kinda thing to be honest... it caused a lot of headaches when I was making it <5> but I'd appreciate any advice; it's certainly not too late to change it <3> what do you mean... it's 1:52 am <6> Jax, haha :) <5> 12:52 here :P <5> I'll use my extra hour hehe <6> Moses, what exactly is league_ranking table here for? <6> Moses, Are you actually going to be updating/inserting into it? <5> that's the table with all the points and goals scored etc information in it <5> yeah, whenever a user posts a result <5> that table would be updated, along with the user_stats table, which keeps overall stat information for each user <6> Moses, what would be the possible value of 'played' 'won' and 'draw' ? <6> and 'lost' <5> well, that's there to track how many games each team has won etc <5> basically, the 'league ranking table' is where all the points and goals etc information about each team goes <6> Ok than your structure should be fine, one sec. <5> then I'm hoping to bring each league together using select mysql statements <5> ah so the structure was ok then? <5> lol that's a surprise actually <6> haha. <8> no that did not help me at all :/ <5> sorry pokerad, I'm a learner myself.. would help if I could <2> !perror 1045; <8> http://pastebin.com/636796 <10> Invalid error number. <2> !perrpr 1045 <2> I hate my fingers. <2> !perror 1045 <6> Moses, well you don't really need 'games played' stored into the db... <6> Moses, because it is simply games won + lost + drawn <5> ah yeah, , I suppose I could have worked that one out actually <7> how can i represent a subtype of a cl*** in relational tables? <7> i need a subtype to establish 1 to N relations <6> Moses, ok try this: SELECT a.username, c.team_name, d.played, d.won, d.drawn, d.lost, d.goals_for, d.goals_against, d.goal_difference, d.points FROM users AS a LEFT JOIN teams AS b ON (a.user_id = b.user_id) LEFT JOIN team_names AS c ON (b.team_names_id = c.team_names_id) LEFT JOIN league_rankings AS d ON (b.team_names_id = d.idteams) ORDER BY d.points, d.goal_difference, d.goals_for <5> ok one sec <5> hey crazytux <5> I think I love you :) <5> lol <6> lol <5> thanks, that seems to work <5> I really need to learn how to do these joins <11> anyone here running gentoo?? I'm having a bit of a problem w/ mysql.. (why does "eselect mysql list" return nothing when I have mysql installed/emerged??) <5> but yeah, that seems to do it :D <5> thanks so much :) <6> Moses, sure no problem. <9> how do I update several columns in one query? :< <5> :) <5> off to get some more work done now, thanks again :) <6> Vooloo, UPDATE TABLE set X = '', Y = '', Z = '' <6> Moses, sure no problem, off to the gym I go; <5> hehe :) <5> cya, thanks :) <9> CrazyTux: but also multiple where <12> I have a problem <6> Vooloo, WHERE x = '' OR y = '' OR z = '' AND THIS = 'that' <4> lots of us do! <4> and xml is the solution I tell ye!
Return to
#mysql or Go to some related
logs:
#kde gaim and flashchat LATAA TURBOPRINT graphiteone ubuntu fedora ati x400 #perl ekstra Castle Ale
ubuntu update_grub
#centos kmyfirewall ubuntu packet
|
|