Jump to content

MargateSteve

Members
  • Posts

    240
  • Joined

  • Last visited

Everything posted by MargateSteve

  1. Not sure why but I thought PhpFeaks had shut down! I stumbled across this looking for something else for the same site I am still trying to create! Simply put, every time I get it close to being what I would consider finished, my eyes get attracted to a better way of doing it (MVC instead of a simple php site, discovering bootstrap, learning SASS, moving everything to AJAX then moving 99% of it back to controller queries and so on) plus a change of job that reduced time to play around with this, grandkids etc. I never did as far as I recall. I seem to recall creating the grid as a php array from the db results was looking the best option. As mentioned above, I am still looking into this so will be stumbling across this again soon.
  2. Thanks mxxd. It is working just how I want now. Talking of the prefixes, as I am using less, I was planning to create some mixins to take the pain out of it, but am now considering using -prefix-free, but don't think it works with imported fonts. Thanks again.
  3. I am building an admin area for a site I am working on with a collapsing sidebar. This works fine except that I wanted it to slide in/out smoothly rather than just disappear/reappear. I tried a JS approach by setting it to 'left:-260px' when collapsed and using show/hide but this caused problems with the rest of the layout. I have also tried adding 'transition: all 0.5s ease;' to the sidebar wrapper class but this did nothing either. Can anyone suggest the best way to go for this? I will be setting up a right sidebar (that is hidden by default) at a later date but want to get the concept right before adding that. JsFiddle Regards Steve
  4. Hi all. Can anyone recommend the best forum software to be integrated with an existing site? I have one at the moment on a site that is being developed (margatefans.co.uk) with SMF but it is far from ideal. When showing things like 'Latest Posts' on pages outside the forum (using SSI.php) it is quite difficult to maintain user level rules so people can only see what they are supposed to see. Also, as the navigation will eventually be dynamic, I have not found a way of succesfully querying a database in SSI.php. I have seen plenty of sites in the past where the forum is part of the site but there seems surprisingly few Google results for it so wondered if anyone here has succesfully done this. Regards Steve
  5. I am trying to get to grips with some of the more advanced .less functions but have hit a bit of a stumbling point. I have read about using 'when' and am trying to change the text color based on the darkness level of the @brand color. What I have is very similar to an example I saw but that one was setting the background too, so that part has been removed. @brand-beige: #F5F5DC; @brand-gray: #808080; .textcolor(@txtcolor) when (lightness(@txtcolor) >= 50%) { color: #fff; } .textcolor(@txtcolor) when (lightness(@txtcolor) < 50%) { color: #000; } /** beige**/ @state-beige-text: textcolor(@brand-beige); @state-beige-bg: @brand-beige; @state-beige-border: darken(spin(@brand-beige, 10%), 50%); /** gray**/ @state-gray-text: textcolor(@brand-gray); @state-gray-bg: @brand-gray; @state-gray-border: darken(spin(@brand-gray, 10%), 50%); When I try to compile it I get the following error SyntaxError: error evaluating function `darken`: Object #<Object> has no method 'toHSL' in W:\wamp\www\Bootstrap\less\test.less on line 12, column 2: 11 .alert-aliceblue { 12 .alert-variant(@alert-beige-bg; @alert-beige-border; @alert-beige-text); 13 } if I change each of the '@state-xxx-text' variables to anything else, like the bootstrap defaults below, everything works fine. /** beige**/ @state-beige-text: darken(@brand-beige, 5%); @state-beige-bg: @brand-beige; @state-beige-border: darken(spin(@brand-beige, 10%), 50%); /** gray**/ @state-gray-text: darken(@brand-gray, 5%); @state-gray-bg: @brand-gray; @state-gray-border: darken(spin(@brand-gray, 10%), 50%); I am sure I am doing something obviously wrong as I am just getting to grips with it. I thought it might be the syntax but have tried @state-aliceblue-text: .textcolor(@brand-aliceblue); @state-aliceblue-text: {textcolor(@brand-aliceblue)}; @state-aliceblue-text: {.textcolor(@brand-aliceblue)}; and all give the same result. If anyone could ive any potential pointers, I would be grateful. Regards Steve
  6. I have removed that part but trying to call html.name still gives 'Returned: undefined'.
  7. I have been banging my head against a wall for a few days over this and think that I have read so many alternative ways, I have got myself confused! What I am trying to do is post some information into the database and on success, provide certain variables back to my script (for example last_insert_id) as I would like to show a success message an add an option to a select on that page. I am trying to get this part working without the mysql first just so I understand it. Currently I can post the data, have that received successfully in the processing page (addDetail.php) and send back output from that page........ insert.php $("#sub").click(function() { var name = $("#name").val(); var town = $("#town").val(); jQuery.ajax({ type: "POST", url: "postScripts/addDetail.php", data: 'name='+name+'&town='+town, success: function(html) { $(".modal-body").prepend( "Returned: " +html ); } }); return false }) addDetail.php $name = $_POST['name']; $town = $_POST['town']; //Check $_POST data echo "<pre>"; print_r($_POST) ; echo "</pre>"; $return["name"] = $name; $return["town"] = $town; echo json_encode($return); Result in insert.php Returned: Array ( [name] => The Name [town] => The Town ) {"name":"The Name","town":"The Town"} This works fine to bring back everything on the processing page in one go but I want to bring back separated variables so I can use them individually. I thought that changing "Returned: " +html to "Returned: " +html.name would allow me to bring back just that variable but it comes back undefined. This is the closest I have got as other methods I tried either brought nothing back or just [objectObject]. How would I be able to bring back both 'name' and 'town' as separated values so I can use them individually in my script? Thanks in advance Steve
  8. Is this page in the same folder as the ones that load it correctly? If not, you would need to change the includes to match the path to the header and footer files. Slightly off topic, is your closing body tag included in footer.php as it is not in that page?
  9. I have been toying around with form validation and have got to a sticking point in four areas that I am pretty sure are easier to do than I am finding! What I have so far works fine - once you start typing in a field, if it is invalid, then there is a message and some extra styling that is removed once it is valid. These are the functions for the four fields so far (there will be more, some required, some not). $('#username').on('keyup', function(){ var valid = /^[a-zA-Z0-9_-]{3,16}$/.test(this.value) && this.value.length; $('#regUsername .regAlert').html((valid?'':'Not Valid')); if(!valid){ $("#regUsername").addClass('bg-danger'); }else{ $("#regUsername").removeClass('bg-danger'); } }); $('#email').on('keyup', function(){ var valid = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(this.value) && this.value.length; $('#regEmail .regAlert').html((valid?'':'Not Valid')); if(!valid){ $("#regEmail").addClass('bg-danger'); }else{ $("#regEmail").removeClass('bg-danger'); } }); $('#password').on('keyup', function(){ var valid = (/^(?=.*\d)(?=.*[a-zA-Z])[0-9a-zA-Z]{6,}$/).test(this.value) && this.value.length; $('#regPassword .regAlert').html((valid?'':'Not Valid')); if(!valid){ $("#regPassword").addClass('bg-danger'); }else{ $("#regPassword").removeClass('bg-danger'); } }); $('#password_confirm').on('keyup', function(){ var valid = (/^(?=.*\d)(?=.*[a-zA-Z])[0-9a-zA-Z]{6,}$/).test(this.value) && this.value.length; $('#regPassword2 .regAlert').html((valid?'':'Not Valid')); if(!valid){ $("#regPassword2").addClass('bg-danger'); }else{ $("#regPassword2").removeClass('bg-danger'); } }); What I am trying to do next is, if any of these fields are not valid, for the submit button to be disabled I can do by including if(!valid){ $('#registerSubmit').prop('disabled', true); }else{ $('#registerSubmit').prop('disabled', false); } in each function BUT if one is invalid, but the next is valid, then this overrides it and the button is clickable again. I have also tried setting a variable to true/false and the same happens. Plus, if all are valid, once the button is clicked, it needs to check for empty (required) fields and only submit if all fields have data. I am also guessing that they is a better way of writing this using a single keyup function and then placing each fields rules within that, but I have tried to wrap it all in a single function but got more in a mess. So, what I am looking for help with (bearing in mind there will be more fields, radio's, checkboxes and selects in the full form) is How can I streamline all of the functions into one to save on repeated code and to make it simple to add more fields in future How can I disable the submit button if ANY of the validations have failed How can I check for any empty required fields on submit button click and not process the form if any are found How can I check that #password and #password_confirm match on keyup from #password_confirm Thanks in advance for any advice Steve
  10. I have started playing around with jQuery mainly to allow me to create complicated forms without clicking through several php pages collecting all the data. It's is probably not relevant but I will give the full picture of what i am attempting feel free to ignore this paragraph if it is of no use! I have a table of MySQL rows with checkboxes. There will be 3 different options for bulk processing of the checked rows and on clicking one of the options a hidden div will fade in and the options buttons will disappear (to prevent several options divs being opened at the same same). In the div there will be form elements relevant to the bulk processing option chosen. For the first one it is simply one text input. Upon Submit it will validate that the input is not empty and if so, execute the function that posts the data. The data gets posted, the div gets replaced and a success message is displayed, plus the bulk option buttons return ready to choose another option. This new div gets hidden once a bulk option next gets clicked. This all works correctly but there is an issue with clearing the validation. So the problem I actually have is that after successful validation and script execution the data is still in memory so if I run through the process again with an empty field, you see the validation error message again, briefly, but the script still runs. Is there any way to clear everything still in memory at the end of script execution? I have tried a few suggestions I have seen and a few things I have tried as a complete guess-up but no joy.... $('#bulkMatchActions').valid=false; $('#bulkMatchActions').validate=false; $('#bulkMatchActions').valid=null; $('#bulkMatchActions').validate=null; removeData(validator); removeData($.post); removeData('#bulkMatchActions'); I am sure that there must be a way to do this but I am completely stumped. If anyone can offer any suggestions I would be grateful. Also, although this code is something I am just playing around with and will not be used on a production site, if there is anything in the scripts that could be done better, feel free to say. but don't be too harsh!! Thanks in advance Steve The Validation part //Validate Defaults jQuery.validator.setDefaults({ debug: true, success: "valid" }); //Validate Rules $(function(){ var validator = $('#bulkMatchActions').validate({ rules: { ppReason:{ required: true } }, messages: { ppReason: "Please enter a reason" } }); //On Submit, run the posting script $('#postponeSubmit').click(function(){ if($('#bulkMatchActions').valid()){ postponeSubmit(); //After the above script is run, I want everything set to NOT VALID ready to validate an empty field again }else{ return false; } }); //Empty the form validator.resetForm(); }); The actual posting script //Postpone function postponeSubmit(){ $('#postponeSubmit').click(function() { var ppSubmit = 'ppSubmit'; var ppReason = $('#ppReason').val(); var checkBox = $.map($('input:checkbox:checked'), function(e,i) { return +e.value; }); var checkBox2 = $('#checkbox'); $('#postpone').fadeOut('fast'); $('#postpone2').fadeIn('fast'); $('#postpone2 p').text('Loading....'); $.post('inc/processForm.php', { ppReason : ppReason, ppSubmit : ppSubmit, checkBox : checkBox }, function(data){ $('#postpone2 p').html(data); showBulkControls(); }); }); }
  11. Although fearful that this question might get spiked due to the broadness of it, here goes.... For my next site I want to integrate social log-ins with the member system. The table set-up is not decided yet for the members but as I have done about half a dozen of these I pretty much know what it will be but for now, just knowing there will be Username, First Name, Surname, Date of Birth and Email for the purposes of my question (I do not want to overcomplicate it needlessly). I would want to have social log-ins, definitely Facebook and Twitter but others if possible, interacting with the members table. I have done a lot of reading-up but cannot find if my set-up wish is actually possible..... Someone can register normally, via a form or by clicking the link/button to register via Facebook or Twitter. During registration they can also add their Facebook/Twitter (depending on their chosen registration method) details. At any point after registration, they can add their Facebook/Twitter details by editing their profile. If a non-logged in visitor clicks to sign-in with Facebook or Twitter, it will check the members table to see if that person already has a matching Facebook/Twitter OAuth registered with my site. If so they will be logged in as that user. If an OAuth match is not found, it will check another set of criteria to see if that matches. I assume that this will be done by pulling the email from Facebook/Twitter. If there is a match on this, it will add the relevant OAuth to the users row in the table. If there is still no match it will ask the person if they have already registered manually (as some people have different emails for different uses). If they say yes, then they will be asked to log-in with their registered username and password. The OAuth will then be added to the users details. If they have not already registered, then create a new member in the table with the OAuth details. I am guessing that if they have First Name, Surname and Date of Birth information on Facebook/Twitter, these can then be pulled into the database. The Username I guess would be more difficult unless before registration is complete they are asked to provide one. Anyway, that is how I have it in my head and I know that there is a lot there but I want to make sure that I know exactly what is possible before I start diving in. If anyone can give any advice as to whether any of the above is not possible or more trouble than it is worth then I would be grateful. Also any other pointers would be very much welcomed. I do not mean to write it for me and also not a generic Social OAuth tutorial as I have already been through stacks of those, but if someone can point me in the direction of anything that covers the specifics of the above that will get me started! Thanks in advance Steve
  12. The clue is in the first word of the error message. Deprecated means that it should not be used as support has finished or the function has been removed. In this case, if you are using php 5.4 session_register() has been removed. Depending on how you are setting 'pass' you could probably replace what you have with $_SESSION['pass'].
  13. Not sure if it is the same but I can't use sendmail from my local Wamp server straight out of the box. I seem to recall there was a way to do it but it was a bit of a PITA. Instead, all I do locally is echo out the email query to make sure it looks like it is doing the correct stuff, then test it properly when I push the page to the live server.
  14. With responses like this to someone giving genuine and correct advice, don't expect further help to come flooding in. However, as a fellow novice who had similar issues when first using sessions I will make a few suggestions. 1. Do not use short opening php tags. Always use <?php. 2. Are you 100% certain there is no output before session_start()? This includes whitespace and physical line breaks. All of my session pages start <?php session_start(); on the very first line with no space before the tag. 3. Google the problem first. Issues with session_start() have been ask hundreds of times over various forums. 4. Don't dismiss suggestions before you try them. 99% of the time the guys on here are spot on. If they suggest something that does not work, the chances are that it is the way you have implemented it. I know that was the case with me a few times. 5. You get out what you put in. If you ask a question clearly, in full words not text speak, give clear examples of what is wrong and speak to people with a bit more respect when they are trying to help, then you will get the solution.
  15. Thanks objnoob. I never realised it would be that simple! Steve
  16. I have recently started venturing in to creating re-usable functions and, as per the tutorials I read up on, have liberally used global. Since starting this, I have started seeing virtually everywhere that this is a bad idea so now am left with around 50 functions that are apparently bad practice! Fortunately all of these are currently in the backend of the site so whatever problems or security risks they cause will be limited to three trusted people. So, before I move onto writing more functions, how would I go about replacing 'global' everywhere? Just to give a rough idea, most of my functions contain 3 'global's, 1 to get the database connection, 1 to create a mysql-friendly timestamp so I can use a small variable for update times etc. and at least 1 to grab a url variable. These are just examples and there may be a few other similar bits and pieces plus some other variables. Say for example I currently have these three globals at the start of my function...... global $con; global $stamp; global $getcomp; and they relate to the following outside of the function //Datebase connection $hostname_mfc = "localhost"; $database_mfc = "xx"; $username_mfc = "xx"; $password_mfc = "xx; $con = mysqli_connect($hostname_mfc, $username_mfc, $password_mfc, $database_mfc); //Simple datestamp variable $stamp = date('Y-m-d H:i:s'); //Get the comp ID from the URL $getcomp= $_GET['comp'];would I simply need to replace the section of the function on the first codeblock with that in the second? It seems a bit silly to need to write the whole database connection in each function so guess that there must be a way around this. Thanks in advance Steve
  17. I am far from an expert but if I understand what you are trying to do, it seems to be a bad way to do it. If you are suggesting that all someone needs to do is enter their username and then be able to edit their details, what is stopping someone from entering someone else's username and editing their details? If it was me I would create a simple log-in script (or if possible use the session details from the forum if it is a 3rd party one). Once the user is logged in, assign their ID to a variable and only allow them to edit the account where the ID matches. Steve
  18. I really think, as is suggested by mac_guyver, that this script will be more trouble than it is worth. Not only would it need completely rewriting initially but as time goes on you will find more problems and a lack of flexibility. If you have access to a MySQL database, there are plenty of tutorials around about setting up basic news scripts. However, if this is not an option, before I moved across to MySQL, I used CuteNews, which is very good at what it does (but I soon outgrew it's limitations).
  19. I have only just had a chance to look at this as I have been working away. I am still getting Fatal error: Call to a member function fetch_row() on a non-object in/homepages/46/d98455693/htdocs/content/1st_team/runin.php on line 580, which is 'while ($row = $res->fetch_row()) {' Any suggestions on what I might be doing wrong? $sql = "create temporary table top8 Select rnk.rownum, rnk.P, rnk.Tid From (Select u.Tm, @rownum := @rownum + 1 As rownum, u.P, u.Tid From (Select Left(t.team_name, 18) As Tm, t.team_id As Tid, Coalesce(Sum(Case When (g.home_team = t.team_id) And (g.home_goals > g.away_goals) Or (g.away_team = t.team_id) And (g.home_goals < g.away_goals) Then 3 Else 0 End) + Sum(Case When (g.home_team = t.team_id) And (g.home_goals = g.away_goals) Or (g.away_team = t.team_id) And (g.home_goals = g.away_goals) Then 1 Else 0 End)) As P, Coalesce(Sum(Case When g.home_team = t.team_id Then g.home_goals When g.away_team = t.team_id Then g.away_goals End) - Sum(Case When g.home_team = t.team_id Then g.away_goals When g.away_team = t.team_id Then g.home_goals End), 0) As GD, Coalesce(Sum(Case When g.home_team = t.team_id Then g.home_goals When g.away_team = t.team_id Then g.away_goals End), 0) As GF From teams t Left Join all_games g On t.team_id In (g.home_team, g.away_team) Left Join seasons As S On g.date Between S.season_start And S.season_end Left Join deductions d On d.team = t.team_id And d.season = S.season_id Where g.comp = '1' And S.season_id = 106 And g.playoff Is Null Group By t.team_id Order By P Desc, GD Desc, GF Desc, Left(t.team_name, 18)) u, (Select @rownum := 0) r) rnk Where rnk.rownum Between 2 And 8 "; $sql = "SELECT u.Tm FROM top8 INNER JOIN teams USING (u.Tid) ORDER BY u.Tm"; $res = $db->query($sql); $blank_array = array(); while ($row = $res->fetch_row()) { $blank_array[$row[0]] = ' '; } $output = "<tr><th>Date</th><th>" . join('</th><th>', array_keys($blank_array)) . "</th></tr>\n"; $sql = "SELECT team, date, fixture FROM ( SELECT h.team_name as team, date, CONCAT('H ', a.team_name) as fixture FROM all_games g INNER JOIN teams h ON g.home_team = h.team_id INNER JOIN teams a ON g.away_team = a.team_id INNER JOIN top8 th ON th.team_id = g.home_team /*INNER JOIN top8 ta ON ta.team_id = g.away_team*/ WHERE date > CURDATE() UNION SELECT a.team_name as team, date, CONCAT('A ', h.team_name) as fixture FROM all_games g INNER JOIN teams h ON g.home_team = h.team_id INNER JOIN teams a ON g.away_team = a.team_id /*INNER JOIN top8 th ON th.team_id = g.home_team*/ INNER JOIN top8 ta ON ta.team_id = g.away_team WHERE date > CURDATE() ) fixtures ORDER BY date, team"; $res = $db->query($sql); $currdate = ''; while (list($tm, $dt, $fix) = $res->fetch_row()) { if ($currdate != $dt) { if ($currdate) { $output .= '<tr><th>' . date('d-M', strtotime($dt)) . '<td>' . join('</td><td>', $fixarray) . "</td></tr>\n"; } $currdate = $dt; $fixarray = $blank_array; } $fixarray[$tm] = $fix; } $output .= '<tr><th>' . date('d-M', strtotime($dt)) . '<td>' . join('</td><td>', $fixarray) . "</td></tr>\n"; ThanksSteve
  20. Thanks Barand, that solved that part. As I have not used temporary tables before I am going to have a read up on those before progressing. Will report back once I have given it a go. Steve
  21. Thanks Barand. Unfortunately I just tried to give it a go and it fell over, probably due to my connection set-up. The error I am getting is 'Fatal error: Call to a member function query() on a non-object in /homepages/46/d98455693/htdocs/content/1st_team/runin.php on line 525'. Line 525 is $res = $db->query($sql); I tried changing this to '$res = mysql_query($sql);' which is what I usually use, which seemed to get past that but that gave me Fatal error: Call to a member function query() on a non-object in /homepages/46/d98455693/htdocs/content/1st_team/runin.php on line 525, which is while ($row = $res->fetch_row()) { $blank_array[$row[0]] = ' '; } I would I be right to assume that $db->query is expecting me to have $db as part of my connection? If this is what is wrong, the connection script I am using for this is $hostname_Test = "host"; $database_Test = "dbname"; $username_Test = "user"; $password_Test = "pass"; $Test = mysql_pconnect($hostname_Test, $username_Test, $password_Test) or trigger_error(mysql_error(),E_USER_ERROR); I have tried replacing $db with both $database_Test and $Test but neither of these worked. Is there anything I need to change with my connection code to make this work? Forgive me if I am way off the mark but everything I have done to date has been in basic and standard php, this bit of code is new to me! Thanks Steve
  22. I would also like to suggest Bootstrap. I have been creating sites for 14 years now and even I now generally use Bootstrap as my starting framework. Even with its basic styling there is enough there to make a reasonable looking site.
  23. Having read back through it, I think that unless anyone has seen what I am trying to do elsewhere it probably does not make a lot of sense so I am going to try to explain it better, It is difficult because I do not know the name of the functionality I am after! I need to run a query on the standings and find out which teams are ranked between 2nd and 8th. These will be my column headers. I need to then find out all of the future dates that there is a game featuring any of these teams. On a particular date only one team may have a game or all may have one. The opponents in these games will feature any of the teams in the league, not just those ranked 2-8. These will be my row headers. In the grid, whenever a date corresponds with a team having a game, details of that game should be shown (home_team,away_team will be fine for now as I am sure I can use php to show just the opponent and whether it is a home or away fixture). if a team does not have a game on the corresponding date, then the cell needs to just be left blank. If two of the featured teams (ranked 2-8 ) are playing each other, then that match will show twice in a row, once for the home team and once for the visiting team. Finally, I would ideally like to use the standings again to show the ranking of the opposing team. So using my example image in the previous post, the first cell would actually read H v Team 2 (10) with '(10)' being Team 2's rank in the standings. I hope that may have made things clearer and not confused it more! Thanks Steve
  24. Once again, I appear to have bitten off more than I can chew with a query I am trying to put together! I am trying to show the fixtures for certain teams in a football/soccer league. Basically I what to show the remaining matches for teams trying to reach the play-offs and set-them out as in the image below. There will be a bit more to it eventually but I think that once I get to that stage, the rest should (a big should) be within my capabilities. At the moment I just cannot get the games for the relevant teams. So far, I have got the following query which gets me the required teams (those currently ranked 2-8 in the standings) and returns their rank, points and team id. Select rnk.rownum, rnk.P, rnk.Tid From (Select u.Tm, @rownum := @rownum + 1 As rownum, u.P, u.Tid From (Select Left(t.team_name, 18) As Tm, t.team_id As Tid, Coalesce(Sum(Case When (g.home_team = t.team_id) And (g.home_goals > g.away_goals) Or (g.away_team = t.team_id) And (g.home_goals < g.away_goals) Then 3 Else 0 End) + Sum(Case When (g.home_team = t.team_id) And (g.home_goals = g.away_goals) Or (g.away_team = t.team_id) And (g.home_goals = g.away_goals) Then 1 Else 0 End)) As P, Coalesce(Sum(Case When g.home_team = t.team_id Then g.home_goals When g.away_team = t.team_id Then g.away_goals End) - Sum(Case When g.home_team = t.team_id Then g.away_goals When g.away_team = t.team_id Then g.home_goals End), 0) As GD, Coalesce(Sum(Case When g.home_team = t.team_id Then g.home_goals When g.away_team = t.team_id Then g.away_goals End), 0) As GF From teams t Left Join all_games g On t.team_id In (g.home_team, g.away_team) Left Join seasons As S On g.date Between S.season_start And S.season_end Left Join deductions d On d.team = t.team_id And d.season = S.season_id Where g.comp = '1' And S.season_id = 106 And g.playoff Is Null Group By t.team_id Order By P Desc, GD Desc, GF Desc, Left(t.team_name, 18)) u, (Select @rownum := 0) r) rnk Where rnk.rownum Between 2 And 8 The first problem is finding all of the matches where any of the team id's (Tid) show in 'all_games.home_team' or 'all_games.away_team'. I have tried using IN and HAVING CLAUSES and used GROUP_CONCAT on Tid but the closest I got was returning the matches for one team. This was the first Tid grouped by GROUP_CONCAT. The other thing that will be vital so probably best for me to solve it early is that I need to show a row for every date that any of the teams have a game on. If one team is playing on a certain date, there must be a row for all teams. It also might be worth mentioning that, as in my example image at the top, there will be times when the when a certain match will be shown twice in a row (once in the home team column and once in the visiting teams column) so I am not sure if those games will need to be pulled out twice? Can anyone give me a starting point on this as I am completely stumped. I have seen this done on other sites but obviously do not know how! I have attached the relevant table data. Thanks in advance for any suggestions. Steve all_games.txt
  25. Are you also storing the match results in the database or just the points? I have set-up a few league tables for sites where the table is created on the fly with php from results stored in the database. Although I have not tried to get it to show points against yet, it should not be too much of an issue. If this would be of any use I can post the code. Steve
×
×
  • 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.