Jump to content

Baxt01

Members
  • Posts

    13
  • Joined

  • Last visited

Baxt01's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok now i again thank you all for been so kind with promp helping of me; and have to say i think the reason i am loving learning PHP is that any error i have had so far is usually dumb and i can work it out with little prompts i just have to go away to work and come back and take a frsh look at my coding and suddenly the issue pops right out at me hahaha i was putting the coding that catain gave me into the wrong file and forgot to change the field names to match my form fields /DOH thanks again peoples
  2. sorry been offline a little while here just startted back into full time employement haha, think i am missing my computer already, thanks for the help but yet again i hit another issue now i am startting to wonder why i want to learn php i have so many issues with my codes, here is my script so far: <?php $player_name = $_POST['player_name']; $fp = fopen('top100stats.txt', 'w'); fwrite($fp, $player_name); fclose($fp); echo '<h2>You data has been saved in a text file!</h2>'; ?> ok i thought i was getting there when i submitted my form and i recived back the message from the "echo" However when i go onto my server and open top100stats.txt it is blank there are no saved records so the server is telling me that a record has been creatted but in fact it is not anyone got any idea why its not saving and not giving an error????????????
  3. i have a form with a <textarea> on it and the usser will submit a list into the text area once they click submit this list is saved into a .txt file on my server the usser's list is formatted as item1 item2 item3 item4 item5 item6 item7 item8 item9 item10 and so on, when they hit submit and this list is saved in my .txt file the list becomes item1item2item3item4item5item6item7item8item9item10andsoon then once saved i am ussing the php to display this on the ending page like this <?php include('top100stats.txt'); ?> to open the contents of the txt file i need some how to keep the orignal list formatting so that each item is on a new line of course there is the list tags <li> but how do i add this tags to my saved .txt file
  4. basically the group that I am making the site for host live online cribbage tournaments and that is the only game that this site is relivent from the list I posted above is how it will always appear any players that play are awarded points per tournament and those acumalatted points are totalled and the top 100 go on the site in a list
  5. after all my research and all your advice's I am now thinking maybe I should go back to my own original method of storing this list in a file on my server as in fopen in php fwrite fclose as the list I posted previous is how it needs to show on my end page if you go to this web page it will show you exactly what it is I am trying to make http://musiccafefriends.webs.com/top100stats.htm I did start to make this site once before using the fopen method and storing my data in a file to recall using the file include method however my unpaid domain crashed and I lost all my work after several un kind words I started looking into MySQL I just used an online character counter and this monthly list will have approx. 1061 characters and that's just the player names this figure is variable as the players are not always the same but there will always be 100 player names per list and of course then there is the points to match the names after viewing the link above you may then say why am I rebuilding a site that's already there and running my answer is that its a .webs.com free domain that is several years old and editing the site has become very slow and hard work
  6. ok davidannis your answer was right on the mark with the truncate happening to the end data I do not know which setting to use to save this much data as I only know how to use varchar, INT, BIGINT, this is a little frustrating I am using a 3 field table to save this data as follows, ID - AUTO_INCREMENT player_name - INT points - INT I know the last 2 only have a 255 character support and this list holds many more characters with the line breaks fastsol I like the sounds of what your saying here but have no idea what it means LOL im a complete neewb to MySQL just so you know when I am working with MySQL on my domain its a dashboard console wizard system I don't get the pleasure of typing commands I log into my domain and go to a dashboard then I click on PHPMYADMIN and even setting up a table is a wizard thanks
  7. is this possible please, I need to be able to allow my users to past a list into a text area on a form that looks like this EZ_DUZ_IT_12 1415 tootie 1245 BigDuke6 1205 HOBOPEG1 1095 nearly_nuts 860 doctor9995 825 Valcar45 790 MC_Tracey 755 Da_witch 750 DJMB 710 MC_bones 710 PR_bernard6 685 CherryGarcia 680 Flag_Lady1 680 Icon_Will_ 635 Kay_ 610 Ginny 580 mooge1 570 PR_BlackSheep 520 PITA 465 bigguy5 460 MC_Fran_Tas_Tic 455 MC_ladyhawk 440 Leisure 435 debbie60fla 420 pepsimissy 420 FireryFun 400 PR_Flo 390 GalleyGal 385 MasterMariner 380 PR_pinky4103 365 sidthekid 355 MtBob 350 Musiclady333 350 PR_MonaMaggee 345 _Zingle_ 325 Sea_Ghost 325 Haleyscomet 320 __Tracey__ 290 jayco_blackie2 280 silveradodude 280 MC_Chef 265 felinepeachy 255 frogette 245 shortone989 245 MC_MuddyBoot 240 thor111 240 GENTLEBEN2 235 johnboy 235 Truegrit 230 Z3_Dar 225 MC_Oinky 220 eagle7374 215 sir_lunchalot 215 Stinger 215 dc210 210 cybillll1 205 GoofyGal 195 GoofyGuy 195 olddogyeller 195 MsDis 180 soccerfan09 180 _dust_ 175 PR_Yolande 175 Scoobie 175 cribdemon 165 PR_Lilywhite 165 digit2 160 RFTS_Moonie_ 160 larousse 155 london_wayne 155 MC_Maddy 155 wascullywabbit 155 PR_Kandy 145 Behavin_Badly 140 mitten 140 the_toaster 140 _Cat_ 135 PegginCajun 130 pops635 130 southern_storm 130 no_dice 125 PR_Candie 125 PR_Junee 125 RFTS_OldMan 125 SnowLady1 105 thekidkicks 105 Trouble_Frantic 105 jimbob57 100 RFTS__nessieee 100 RG_Terrace 100 EVIL_UNICORN 95 Just_Lindy 95 RFTS_Zap 95 PR_Black_Widow 90 RFTS_Cille 90 RFTS_Puffin 90 PR_iplay_wild 85 UBG_TAI_PAN 85 AgentOrange 80 Poet 80 this is a list of tournament players and their awarded points for the month the group need to be able to paste this into my web form as it is so that it saves into MySQL table then I can pick this up and re display it for the players to view when I am trying to get this to appear as a list looking like this it shows as a paragraph and not all the info is been saved and returned anyone got any ideas please
  8. lol yeh that would be so much easyer for me if I was manually assigning the number value for each record however I am not even the one adding the data to the table I am making this for a voluntary group of iliterates (no offence ) I need it to be an auto generated numbered ID for the primary key
  9. HAHA that's just too funny Guru only because that's exactly what it was but I worked it out for myself right after I posted on here LOL just after I posted on here I went back to my domain looked at the same coding I had posted on here and logged into MySQL and started just looking at everything, once I got into my tables and stuff I checked my structure and a few other options then realised that I was trying to insert into a tabled named " top100stats " the correct path I was needing to use was " top100standings "............. I think that the reason I am struggling with MySQL so much is that all tutorials refer to manually typing all the commands however on my domain with neq3.com this is not how its done I have a console everything is done using a wizard system for instance I had to change my table as I had 3 column's id, player_names & points the id column was supposed to be an auto integer so that the user never had to add data to this column however when I tested this for some reason it was adding zero to the first record then was trying to add zero to the second which is not allowed so was throwing me a new error so I read about this and everyone was saying use AUTO_INCREMEANT but in my console I could not find any option to do this so I decided to do away with that column so all in all THANK YOU all for your help with setting this up even when your help has made me go away and research and learn my own help rather than giving me the answers
  10. ok I am back again ha ha so I took on board the advice you guys were all pointing at which was using MySQL database not fopen and sat reading a tutorial until a stupid hour in the morning after I finished work and I made a DB and created a table in there named " top100stats " here is the php I used; <?php $con=mysqli_connect("mysql.neq3.com","u1*****103_mike","K*****id11","u1*****103_mike"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql="INSERT INTO top100stats (player_name, points) VALUES ('$_POST[player_name]','$_POST[points]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } echo "1 record added"; mysqli_close($con); ?> ok now I am pretty impressed with myself at this point as you will see in a sec I actually managed a conection to MySQL, and now for the BUT in this the part im not understanding is this error message I am reciving when I input to my form and submit it sends the data to a file named " dbconect.php " which then is supposed to add the record into my table ( code for this page above ) the error is; Error: Table 'u1*****103_mike.top100stats' doesn't exist now of course for my security I have used the astrix to hide parts of my user ID in all codes and error messages I understand the error is telling me that it's looking for a table named with my user name and my table name but why is it doing this to me oh did I say I don't really know my about MySQL I just read a tutorial over night and then produced this coding lol I love learning and I hope you guys love teaching here thanks in advance
  11. I took your advice as above and scraped that stupid code because everytime I fixed a syntax a new one poped up so I re did it from scratch here is my new code: <?php $fp = fopen('top100stats.txt', 'w); fwrite($fp, '$player_name'); fwrite($fp, '$points'); fclose($fp); // the content of 'data.txt' is now 123 and not 23! ?> haha now then spot my error as when the form is submitted it passes to this code and this code passes to the text file which is what I want however instead of passing the form variables $player_name $points that info is lost and I get the coding $player_name $points in my text file in the mean time im sitting a crash course in MySQL lolol
  12. haha yes just simply adding the 'w' after the comma fixed line 2 lol but moved to an new error on line 3 Parse error: syntax error, unexpected '>' in /home/u159756103/public_html/top100stats.php on line 3 i agree about your uneasyness with the raw data from a post but i figured that the site i am building is a free site for a low risk group of volenteers also i know nothing of mysql databases although i have managed to create a table using the system's already on my server which are phpmyadmin and mysql databases just when i try to connect to my table to add the records from my web form i get all kinds of issues connecting
  13. hi I have been trying to get a way of building a site for a online gaming community where they can post player points to a form so that I can make them be displayed in a list on a different page after editing simply the group director gets the edited points from excel and pastes them into my html form then using file include in my page the results display in a page for viewing this is what I got so far but now I am getting stupid error messages <?php $player_name = $_POST['player_name'];$points = $_POST['points']; $fp = fopen(”top100stats.txt”,); fclose($fp);echo “<h1>You data has been saved in a text file!</h1>”; ?> this is the error I get Parse error: syntax error, unexpected ')' in /home/u159756103/public_html/top100stats.php on line 2 any help would be great as I was trying to do this using MySQL however after making my table I could not get php to write thew form data into it hahaha as you can see I am very new to php and mysql
×
×
  • 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.