Results and League Generator |
[eluser]ajh_8[/eluser]
Hi everyone, Hoping someone can help me with a problem on my current project. I'm trying to create a league table generator for a sports website. I'm hoping to add a result of a match which will then update the league table (points, games played, goal difference etc) as well as saving the result itself for referral for teams progress etc. Below is my current attempt, so if anyone can help me out, that would be great! Thanks in advance! Controller: Code: function index() { Model: Code: function add_result() { View: Code: <? $status = validation_errors(); if (isset($status)) { ?>
[eluser]LuckyFella73[/eluser]
You didn't make clear what the actual problem is. Do you get error messages, is your code not working as expected or are you asking for a better approach to do this? Please post more details about your problem then you will get help faster.
[eluser]ajh_8[/eluser]
Apologies about the lack of information. When processing the form it's giving the following error message: Unknown column '3' in 'field list' INSERT INTO `teams` (`3`) VALUES ('') So it's recognising the number of points as a field when it's meant to be adding that number to a points field. It's also recognising what team has the highest amount of goals to give the designated points too, (which is what is required) but is not adding the number of points. I'm not sure whether the way I have approached it is the best way to do so or whether I should go another route?
[eluser]LuckyFella73[/eluser]
Your INSERT command is wrong. The right synthax is like this: Code: // from CI userguide You can also set up your insert values like this: Code: // from CI userguide as well This page of the Ci user guide should makes some things clearer: http://ellislab.com/codeigniter/user-gui...ecord.html Got to leave office now .. cheers and hope you get it to work now! |
Welcome Guest, Not a member yet? Register Sign In |