Jump to content

djrichwz

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

djrichwz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks I will try that when I get back from work probably tommorow now. I will let you know If it works ok but I think that is doing what I need to do.
  2. I have created a form which inserts a value into the database from a drop down box, this works fine the problem comes when i try to edit that value using an edit form within my edit script. I want to create the dropdown box say for instance option 1 option 2 option 3 If one of the options above is the same as one in the db I want that to be the default selected value for the drop down box. I do not really know where to begin with the code for this. I have been figure this out for ages. Please can someone help ???
  3. no i havent specified a characterset for the page (how do you do that) and yes it is using htmlentities Code: include('dbinfo.php'); // connect to DB. $conn = mysql_connect( $dbhost, $dbuser, $dbpass ); mysql_select_db($dbname); $result = mysql_query("SELECT * FROM history order by ID DESC"); $row = mysql_fetch_array($result) or die(mysql_error()); $history=$row['history']; $quote = nl2br(htmlentities($history)); echo $quote."<BR>\n"; I used htmlentities to solve the hyphen problem (text-text)
  4. I have a problem where If I insert text into the mysql with single quotes such as 'treble' the quotes do not display on the retrieved result they display as �treble�. How do I solve this with php I cannot move on with this project until this is solved please can anybody help. :-\
  5. thanks very much that worked great for inserting it into the database. cheers
  6. 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
  7. How do I change the encoding so it does not display these unrecognised characters. thanks in advance
  8. I am getting a text result from the mysql database which has both "-" and single quote marks used. How do I remove the unrecognised characters show below: I have tried htmlentities which does remove the "-" but does not remove the single quotes. How can I remove these in the output also How can I add a space inbetween text result from a database ie (output) Change to (out put). Here is what is displayed on screen: �double� here is the code I am currently using to display this result: $quote = nl2br(htmlentities($history)); thanks in advance for your advice.
  9. Solved It thanks to all your help i used this code in the end $sql = "SELECT * FROM results where resultteam='$team' order by ID DESC LIMIT $start,$pageLimit";
  10. Ok now it validates but with the code i am using does not display any records but it works without that where statement. here is my code: resultteam is my db field Varchar(45) code: <?php $team=$_GET["t"]; $results=$_GET["results"]; If ($results=="final") { include('dbinfo.php'); // connect to DB. $conn = mysql_connect( $dbhost, $dbuser, $dbpass ); mysql_select_db($dbname); $result = mysql_query("SELECT * FROM finaltable order by ID DESC"); $row = mysql_fetch_array($result) or die(mysql_error()); $finaltable=$row['finalresults']; If ($finaltable==NULL) { echo "<P>No Current Final Results Table<BR>Please Check Back At The End Of The Season</P>"; }else{ $finalresults = nl2br(htmlentities($finaltable)); echo "<P>"; echo "<B>BTFC Final Results Table 2008</B>"; echo "<br><br>"; echo $finalresults; echo "</P>"; } }else{ $team=$_GET["t"]; $results=$_GET["results"]; // Start Results Page include('dbinfo.php'); // include your code to connect to DB. $conn = mysql_connect( $dbhost, $dbuser, $dbpass ); mysql_select_db($dbname); $noEntriesQuery = mysql_query("SELECT * FROM results") or die(mysql_error()); // read the number $noEntries = mysql_num_rows($noEntriesQuery); // set page limit $pageLimit = 5; // calculate the number of pages $noPages = ceil($noEntries / $pageLimit); // current page $currentPage = 0; // check if the $_GET value exists, if yes.. set the $currentPage to that value if(isset($_GET['spag']) && is_numeric($_GET['spag']) && $_GET['spag'] > 0 && $_GET['spag'] < $noPages){ // the test passed, set the current page $currentPage = $_GET['spag']; } // start number $start = $currentPage * $pageLimit; // the query for the current page $sql = "SELECT * FROM results WHERE 'resultteam'=$team' order by ID DESC LIMIT $Start,$pageLimit"; $result = mysql_query($sql,$conn); if($sql){echo " Command is successful ";} else {echo "Command is not successful ";} echo $team; // Start Results Loop while($row = mysql_fetch_array($result)) { echo "<BR>"; echo $row['resultdate']; echo "<BR>"; echo $row['resultdetails']; echo "<BR>"; } echo "<BR>"; // Query for number of pages for($a = 0; $a < $noPages; $a++){ if($currentPage == $a){ echo "PAGE"; echo ($a+1); }else{ echo '<a class="pagelinks" href="'.$_SERVER['PHP_SELF'].'?content=results&results=match&t='.$team.'&spag='.$a.'">'.($a+1).'</a>'; } if($a < $noPages - 1){ echo '-'; } } //End Results Page } I presume this is still part of the same problem sorry if it is not considered part. can anybody help thank you for your help so far can anybody help
  11. Afraid Not I still get the same error message. Thanks for your continuing help Hopefully we can solve this
  12. No Im afraid it did not work just gave me a blank page like when the php script insnt working. There was no sql error either. sql error in my syntax: 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 '5' at line 1
  13. I am fairly new to php but have been doing quite well at understand the php and mysql but i just cant seem to get the syntax right with the below sql statement. $sql = mysql_query ("SELECT * FROM results WHERE resultteam='$team'" order by ID DESC LIMIT ".$Start.",".$pageLimit); can anybody help please
  14. no im afraid this does not work all i get is: Warning: Division by zero in /home/www/djrichwz.100webspace.net/test4.php on line 12 1 2 3 I cant figure this one please does anybody have any idea of what i can do.
  15. sorry guys i had to go work and had to go to my mums birthday at the weekend i will try it now.
×
×
  • 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.