Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:36:10+00:00 2026-06-07T09:36:10+00:00

I’m relatively new to PHP, I’m back in school after working in an unrelated

  • 0

I’m relatively new to PHP, I’m back in school after working in an unrelated field for a number of years. I’m working on an outside project for my Dad and have run into what appears on the surface to be an easy-to-solve issue that I can’t seem to resolve.

On the page in question it displays a list of players in a league and their score. The form below it has a text box allowing you to enter a name and three buttons; one to add the name as a player (with a default score of 0), delete that player from the list of players, and a third to adjust the score for that player. I got the first two (“add” and “delete”) to work as I’d like, however where I’m running into a problem is with the score adjustment one.

If you click the “adjust score” button it displays a new text box to enter the score along with another button to actually submit it. The problem is nothing happens when you press the new button to adjust the score, at this point I’ve just got a test “echo” statement in there that should be displaying on submission, but that’s not happening. Below is the code in question. Any thoughts on how I can fix? Thanks for any suggestions.

<html>
<head>
    <LINK REL="stylesheet" type="text/css" href="styles/footballTest.css" />
    <title>VFW Football testing</title>
</head>
<body>
    <?php
        $dbConnect = mysql_connect("localhost", "root","");
        $dbName = "vfwleaguetest";
        $getPlayers = "SELECT * FROM `players`";
        if(!$dbConnect)
        {
            echo "<p>Connection failed</p>";
        }   
        if(mysql_select_db($dbName, $dbConnect) === false)
        {
            echo "<p>Could not select the database ".$dbName ."<br/>".mysql_error($dbConnect)." </p>";
        }
        if(isset($_POST['submit']))
        {
            $name=@$_POST['nameAdd'];
            $playerAdd = "INSERT INTO `vfwleaguetest`.`players` (`playerName`, `seasonTotal`) VALUES ('".$name."', '0')";
            if(mysql_query($playerAdd, $dbConnect) === false)
            {
                echo "<p>Error adding player to database: ".mysql_error($dbConnect)."</p>";
            }
        }
        unset($_POST['submit']);
        if(isset($_POST['delete']))
        {
            $name= @$_POST['nameAdd'];
            $playerDelete = "DELETE FROM `vfwleaguetest`.`players` WHERE `players`.`playerName` = '".$name."'";
            if(mysql_query($playerDelete, $dbConnect) ===false)
            {
                echo "<p>Error deleting player to database: ".mysql_error($dbConnect)."</p>";
            }
            else
            {
                echo $name." successfully removed from player list";
            }
        }
        if(isset($_POST['adjust']))
        {
            ?>
            <br/>
            <input type='text' name='scoreAdjust' size=5 />&nbsp;
            <input type='submit' name='fixScore' value='new season total for <?php echo $_POST['nameAdd'];?>' />
            <?php
            if(isset($_POST['fixScore'])) //THIS IS WHERE THE PROBLEM SEEMS TO LIE
            {
                echo "after fixScore click";
                //add sql below
            }
        }   
    ?>
    <form name="players" action="" method="post">
    <?php
        $playerList = mysql_query($getPlayers, $dbConnect);
        echo "<table><th><tr>";
        echo "<td>Player name</td><td>Season total</td></tr></th>";
        while(($row = mysql_fetch_row($playerList)) != false)
        {
            echo "<tr><td>$row[0]</td><td>$row[1]</td></tr>";
        }
        echo "</table>";
    ?>
    Manage players&nbsp;<input type="text" name="nameAdd" />&nbsp;
<input type="submit" name="submit" value="add" />&nbsp;
<input type="submit" name="delete" value="delete" />&nbsp;
<input type="submit" name="adjust" value="adjust score" />
    </form>
</body>
</html>    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:36:12+00:00Added an answer on June 7, 2026 at 9:36 am

    the problem is score adjust inputs are out of the form:

    <input type="text" size="5" name="scoreAdjust">
    <input type="submit" value="new season total for aaa" name="fixScore">
    

    you need:

    <form method="post" action=''>
      <input type="text" size="5" name="scoreAdjust">
      <input type="submit" value="new season total for aaa" name="fixScore">
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.