Jump to content

[SOLVED] unable to insert data from a textarea into the mysql database


djrichwz

Recommended Posts

I keep getting this error when trying to insert the text from the texarea into the database:

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'barracks' side, playing in white shirts with the nick¬name the "Lilywhites". The' at line 1

 

I think I know what is wrong but i dont know how to solve it. I think it is having a problem with the characters used in the text ie(nick-name).

 

Here is the text im trying to insert:

 

The Club was founded in 1889 by W.M. Pethybridge and C.H. Bray, therefore had the distinction of sharing its centenary year with the C.C.F.A. As well as being co-founder of the club, Mr Pethybridge also played for Bodmin Town, mainly at centre-half. In later years he continued his association with the club, becoming a Vice-president. Between 1891 and 1898 he played for the County and captained the side in 1895. Although known as a centre-half, he played in every position except goalkeeper for Cornwall.

Bodmin played originally at Cooksland, off the Liskeard road, then moved to Coldharbour Lane, Barn Park, back to Cooksland, then Westheath and finally to Priory Park.
Following the 1914/18 war, the club played in junior football. After being runners-up in the Junior Cup (Eastern Section) in 1921, the club was granted senior status. In 1922/23 they were runners-up in the Senior Cup, also Champions of the Bodmin & District (Senior) League, repeating the latter again in 1926/27.

At the beginning of the Twentieth Century the club joined forces with the 'barracks' side, playing in white shirts with the nick¬name the "Lilywhites". The club adopted its familiar black & amber colours in 1925, starting off in stripes, changing to a quar¬tered shirt, then reverted back to a striped kit before adopting the present amber shirt with black piping.

After the 1939/45 war, the club again played in junior football and were runners up in the Junior Cup and Bodmin & District League in 1947/48. Following this success they were once more promoted to senior status. In 1948/49 the club had five County players: G.L. Cocks, R.P. Hylatt, A.R. Smith, E.M. Harper, and J.A. Walton, the latter also an England player.

In 1953/54 the club joined the South Western League, which had been formed two years earlier. After a slow start, the club began to establish itself, finishing 5th in 1955/56, then 4th in 1958/59. Three years in the bottom half followed before the club withdrew from the South Western League, to play in the East Cornwall Premier League. In 1969/70 the club re¬joined the SWL where it has remained to this day, over 30 years of continuous mem¬bership.

The club enjoyed reasonable success in the early to mid 1970's, mainly under the man-agement of Johnny Williams followed by Bobby Baxter, then went through a lean spell until the mid 1980's when the club appointed Ricky Cardew, who had  played for the club in the mid to late 1970's.

In a 12 year period the club won every Senior honour in local football, two SWL championships, 2 League Cup victories, 3 Charity Cup wins, a Cornwall Senior Cup win and an excellent run in the F.A. Vase, reaching the fourth round (last 32) in 1997/98. The Club had its best every season in 1993/94 with its first League & League Cup ‘double’ as well as reaching the final of the Cornwall Senior Cup

During the 1990's the club were fortunate to host several attractive friendlies. First Division (now Premiership) Queens Park Rangers, Southampton and Sheffield Wednesday have been followed by Sheffield United who have visited Priory at the start of the last three seasons. All these top sides have been impressed with the club's set-up, which are among the best in the South West.

Following the departure from the club of Ricky Cardew in September 1999, the club introduced a youth policy with Sean Hooper taking over as manager. The much-changed side finished in a mid-table position.

In 2000/2001 the side struggled from the start and had to apply for re-election for the first time in 16 years. This being suc¬cessful, a few experienced players signed for the 2001/2002 season to support the younger players. After a good start the side lost one or two players which affected the team's subsequent performances. October 2001 saw Sean Hooper leave the club, with Steve Trotman taking temporary charge before handing over control to for¬mer Bodmin Town goalkeeper, Paul Hicks. The good form of earlier in the season returned to the squad and the side climbed steadily up the table, only to lose consis¬tency and end the season in a mid table position.

The 2002/2003 season saw three changes of manager and numerous players come and go, the Club ending the season in last place, having to apply for re-elec¬tion for the second time in three seasons. With the application being successful, the club went for experience, appointing the former Porthleven manager, Alan Carey for the 2003/04 season in the hope of returning the club to being one of the top sides in Cornwall.

From the start of the new season it was clear that the side was capable of challeng¬ing for honours, and with an unbeaten run of 23 league matches led the table for most of the season, but a spell of three league defeats in four matches gave the lead back to their rivals. Despite regaining their form, the team had to settle for runners-up. Although disappointing at the time, this was the best league position for the club in nine seasons. In addition the team reached the semi-finals of the Carlsberg South Western League Cup as well as the quarter finals of both the Cornwall Senior and Charity cups.. The club also had the honour of having several players picked for both the SWL and Cornwall sides, for the first time in several seasons, the latter win¬ning the SW Counties Championship for the first time in the history of the competi¬tion. 

The  2004/05 season proved similar to the previous one, with the Club finishing as runners-up in the Carlsberg South Western League again. Although the League Cup and Charity Cup ended disappointingly early, the final of the Cornwall Senior Cup was reached for the first time in six seasons. Also the team had an excellent run in the FA Carlsberg Vase reaching the fourth round, which equaled the Club’s best performance in the competition. 

Roger Fice joined the management team for the 2005/06 season, Achieving a League and League Cup ’double’ for the first time in 12 years gave Alan Carey a much deserved Championship, after so many near misses.  In addition the side also reached the finals of both the Cornwall Senior and Charity Cups, making the 2005/06 season probably the best to date in Bodmin Town’s long history. The Club also entered the F.A. Cup for the first time and had two excellent matches. Exempted to the second round of the F.A. Vase, the team had two excellent matches, the second being away to Sudbury in Suffolk, who had reached the final for the previous three seasons. The side put in a great performance before going down to a narrow defeat. With a ‘double’ and two cup finals to celebrate at the end of the season, the partying went on until the Club’s annual dinner at the end of May.

The 2006/07 season was expected to be very closely fought, but no one could have predicted just how tight the battle for the final South Western League title would turn out to be. An early exit from the League Cup, the FA Cup and the FA Vase left Bodmin Town to concentrate on retaining the League title. This began well staying undefeated until mid October when a surprise defeat ended the excellent start, but a run of thirteen unbeaten league matches, kept the side near the top of the table. Roger Fice left the club midway in the season. A disappointing loss in the quarter final of the Senior Cup, meant the Cornwall Charity Cup was the only cup competition remaining. Reaching the final, again against St Blazey we lost out in a penalty shoot-out by 10-11. With the league drawing to a dramatic climax all sides had jittery spells. However, on the final day we still had a chance to retain the Championship, having to beat Liskeard and rely on other results. Our last match ended in a draw and we finished in fourth place, just three points behind the eventual League Champions.

An inconsistent start to life in the newly established Carlsberg South West Peninsula League, saw two defeats in the first four League games, although there were notable absentees from the team in these early matches. However, we did well to reach the 1st qualifying round of the FA Cup, to play Team Bath from the Premier Division of the Southern League. The team put in an excellent performance, conceding two late goals, after having the better of the play for long spells. The FA Vase ended disappointingly, with defeat in the 2nd qualifying round at Budleigh Slaterton. Victory in the Cornwall Charity Cup followed as did more consistent performances. Following a disappointing loss at home to Tavistock at the end of October, the team started a remarkable sequence of results, which saw just one more defeat in all matches for the remainder of the season, that being in the Cornwall Senior Cup semi-final against Saltash United, and only after extra time. This incredible run saw 25 League matches unbeaten, which included 15 straight wins, with just the one defeat in all competitions over 36 matches. The League title was one with two matches to spare and by a clear 10 points. This was followed by victory in the Throgmorton Cup Final to give the Club its second ‘double’ in three seasons. To cap this the Cornwall Charity Cup was won, for a very first ‘treble’ achieved by the Club.

With major developments at Priory Park starting in October 2008, the Club has had to make huge changes to its structure and is looking forward to exciting and challenging times ahead, which will see teams for all ages and abilities formed over the next few years.

 

Here is my insert statement I know it works because when I put in text without those characters it inserts it into the db.

 

Insert Statement:

 

$history = $_POST["history"];
					If ($history<>"") {
					mysql_query("INSERT INTO history (history) VALUES('$history') ") 
					or die(mysql_error()); 
}

 

Can anybody help with a way that I can insert this into the database but also when I retreive it from the database it will keep those characters intact.

 

Im really stumped on this one.

 

thanks in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.