Everything posted by raybowls
-
cannot enter several records with one form
I'll give that a try and I can see the sense in taking it slowly but this is a two edged sword, my main target has been to learn php-mysql and I am using our bowls club to learn with, it would be nice to end up being able to service a web site for our bowls league. (impatients I'm afraid). Thanks again Ray
-
cannot enter several records with one form
Thanks for your reply Yes still struggling - but learning a lot along the way - the GET came from trying different things, forgot to change it back, done that now. If I change the input names for the records after the first one how will the info show in the relevant fields, ie, number field will be different to number_a field, or is my thinking wrong. I could enter a list of results directly into mysql using a comma, I am trying to replicate that through php, am I trying the impossible. ? Ray
-
cannot enter several records with one form
I am trying to enter several records from one form but all I get is the last record entered, I am hoping some-one can see my errors, just learning php so please be gentle with me. <form action="process2.php" method="post"> Number: <input type= "text" name="number" size='3'/> Shots Scores: <input type= "text" name="shots_for" size='3'/> Shots Against: <input type= "text" name="shots_against" size='3'/> Points : <input type= "text" name="points" size='3'/><br /><br /> Number: <input type= "text" name="number" size='3'/> Shots Scores: <input type= "text" name="shots_for" size='3'/> Shots Against: <input type= "text" name="shots_against" size='3'/> Points : <input type="text" name="points" size='3'/><br /> <input name="submit" type="submit" value="submit" /> </form> <?php $number=$_POST['number']; $shots_for=$_POST['shots_for']; $shots_against=$_POST['shots_against']; $points=$_POST['points']; mysql_connect("localhost", "root", "*******") or die(mysql_error('Could not connect to mysql')); mysql_select_db("bowls") or die(mysql_error('could not connect to db')); mysql_query("INSERT INTO results VALUES ('$number', '$shots_for', '$shots_against', '$points')"); mysql_query($query); $num=mysql_numrows($query); $i=0; while ($i<$num) { $query="('$i.$_GET[number]','$i.$_GET[shots_for]','$i.$_GET[shots_against]','$i.$_GET[points]')"; $i++; } $mysql_query=substr($mysql_query,0,-1); //This will remove last comma Print "Your information has been successfully added to the database."; ?> Any help much appreciated Ray
-
Entering Results into mysql
We have 10 teams with 8 players in each team, each team and each player have unique numbers within the database spread over several tables which I can join to bring back league tables and individual averages. I started this back in October as a winter exercise to see if I could learn php and mysql and build a web site for the league I play in. (all done for free of course). I seem to making some progress using css/html/apache/mysql/php and with the very generous help of you very kind people on this forum. I have put the players details in one table, results in another table, league details in another table and join them up when needed. this makes it easy to put results in by using the unique id which is the same in each table. Sorry for the long speel but I thought it might help if you knew where I was coming from. Ray
-
Entering Results into mysql
Just using a simple form within html. <form action="proresults.php" method="post"> id: <input type="text" name="id"><br> Shots For: <input type="text" name="shots_for"><br> Shots Against: <input type="text" name="shots_against"><br> Points: <input type="text" name="points"><br> id: <input type="text" name="id"><br> Shots For: <input type="text" name="shots_for"><br> Shots Against: <input type="text" name="shots_against"><br> Points: <input type="text" name="points"><br> <input type="Submit"> Trying it out with 2 entries, if that works I can add the full team results in later. If I only set it up for 1 entry it works fine. Ray
-
Entering Results into mysql
I am sorry if I seem a bit dim but I am just learning mysql/php. Do you mean use this code you printed instead of mine or incorporate it into mine some-how. Regards Ray
-
Entering Results into mysql
This is what I am using for sungle entries: <!-- USED WITH FETCHRESULTS.PHP TO ENTER PLAYER RESULTS INTO BOWLS.DB - RESULTS TABLE--> <html><body> <?php include 'opendb.php'; // THIS WORKS FOR SINGLE ENTRIES BUT NOT FOR MULTI ENTRIES $id=$_POST['id']; $shots_for=$_POST['shots_for']; $shots_against=$_POST['shots_against']; $points=$_POST['points']; mysql_connect(localhost,$root,$******); @mysql_select_db("bowls") or die( "Unable to select database"); $query = "INSERT INTO results VALUES ('$id','$shots_for','$shots_against','$points')"; mysql_query($query); if($result = mysql_query($query,$results)) { echo "<h3>Thank you</h3>Your information has been entered into our database<br><br>"; } mysql_close(); ?> </body></html> Thanks for your reply Ray
-
Entering Results into mysql
Hi I am trying to enter results from club comp's into mysql using php, something like this: player A result - listing 4 fields player B result - listing 4 fields etc Having set up a form for secretaries to log into I can enter one entry ok but do not know how to set up a form to do multiple entries. Any help much appreciated. Ray
-
BEWARE - Yell.com
You are right about not using directories, skill and hard work are about the only things that work in the long run, trouble is we all spend money trying to find the "easy way".
-
Format text from mysql
Thanks for that tip - being a novice at this game it took me a few goes to get it running correctly but it seems to work just as I wanted. Thanks again for your help. Ray
-
Format text from mysql
Yes I am using phpmyadmin but other people will also be entering info in and they will not know the tags to use. Thanks Pat Ray
-
Format text from mysql
Hi - I am trying to get text from mysql to show on a web page with the paragraghs in place, all I am getting is long lines of text. This is the script I'm using to get the last item of text from the db. <?php // USED WITH MAIN PAGE OF WEB SITE TO DISPLAY NOTES $query = "SELECT * FROM notes ORDER BY id DESC LIMIT 0, 1"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "{$row['notes']} <br>"; } I've tried using nl2br within the code but cannot get it to work. Having looked through 2 books and searched many forums I thought it was time to ask for help. Any help much appreciated Regards Ray
-
seeking advice on web site building
Thanks you all for your help, what I think I will try is learn PHP - use this with javaScript, CSS, HTML, (all of which I will have to gain further knowledge on) and try to build a site from there. This way I feel I will be staying in control of content and any changes in the future. My problem was coming to this sort of decision from my obvious lack of knowledge. All your help as been very much appreciated. ( if any-one thinks I am making a mistake by going this way please tell me ). Ray
-
seeking advice on web site building
Hi Pat Thanks for your reply. Will I need to use cms to be able to allow secretaries to log onto the site so that they can enter in their match results. Ray
-
seeking advice on web site building
If I went down this route would Secretaries be able log on to the site and update their weekly results ?, I think this may be my main stumbling block, what do you think. Thanks for your reply by the way. Ray
-
seeking advice on web site building
Thanks for your help, I will have a look at your suggestions. Ray
-
seeking advice on web site building
Hi - i'm new to the site and I wondered if any-one could give some advice. I am a member of a bowling club and would like to build a web site for them, we would need to be able to show league tables and individual stat's, and if possible allow club secretaries to be able to update their results via the web site. So far I have build a site using CSS and HTML but this looks like it needs a lot more detail to do what we need. I have been looking at MySQL with PHP but this a lot to learn if it is the wrong way to. Pointing in the right direction is really what I am looking for. Any help much appreciated Thank Ray