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 7574723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:30:18+00:00 2026-05-30T16:30:18+00:00

I am a little lost being new to databases. I am trying to create

  • 0

I am a little lost being new to databases. I am trying to create a page/form that, from a link only the admin can see, pulls in that $id’s information from the database, displays it so that each field can be updated and saves it back to the database. I also added a form at the bottom of the page to input a new field into the database. For simplicity sake I put them on one page but I can separate them out if needed. My code does not work yet and any help would be greatly appreciated.

echo "<a href=\"test.html?p=ID{$row["id"]}\">Edit</a><br>";

spits out a link to test.html?p=ID(#)
The link part is working perfectly.

Admin page

<div><h1 class="pageTitle">Episode List UPDATE</h1></div>
    <?php
// Connect to the database
require 'include/episodelist.db.php';

// Ask the database for the information from the season table BUT how to only get info for the ID?
$query="SELECT * FROM `season` WHERE `id` = $id";
$result = mysql_query("SELECT * FROM season");
$num=mysql_numrows($result);
mysql_close();
?> 
<form action="include/epslist.update.php" method="POST">
<table>
<tr>
<td>Season Number: </td><td><input type="text" name="season_sum" size="50" value="<? echo "$season_num";?>"></td>
</tr>
<tr>
<td>Episode Number: </td><td><input type="text" name="eps_num" size="50" value="<? echo "$eps_num";?>"></td>
</tr>
<tr>
<td>Temp Episode Number: </td><td><input type="text" name="temp_eps_num" size="50" value="<? echo "$temp_eps_num";?>"></td>
</tr>
<tr>
<td>Title: </td><td><input type="text" name="title" size="50" value="<? echo "$title";?>"></td>
</tr>
<tr>
<td>Description: </td><td><textarea type="text" name="descrip" cols="50" rows="7" value="<? echo "$descrip";?>"></textarea></td>
</tr>
<tr>
<td colspan="2">
<input type="Submit" value="Update">
</td>
</tr>
</table></form>
<div class="Down10px"></div>
<div><h1 class="pageTitle">Episode List NEW</h1></div>
<form action="include/epslist.new.php" method="POST">
<table>
<tr>
<td>Season Number: </td><td><input type="text" name="season_sum" size="50" value="<? echo "$season_num";?>"></td>
</tr>
<tr>
<td>Episode Number: </td><td><input type="text" name="eps_num" size="50" value="<? echo "$eps_num";?>"></td>
</tr>
<tr>
<td>Temp Episode Number: </td><td><input type="text" name="temp_eps_num" size="50"></td>
</tr>
<tr>
<td>Title: </td><td><input type="text" name="title" size="50"></td>
</tr>
<tr>
<td>Description: </td><td><textarea type="text" name="descrip" cols="50" rows="7"></textarea></td>
</tr>
<tr>
<td colspan="2">
<input type="Submit" value="New Item">
</td>
</tr>
</table></form>

epslist.update.php

<?php
require "episodelist.db.php";

//Test for user inout
if (!empty($_GET[season_sum])&&
    !empty($_GET[eps_num])&&
    !empty($_GET[temp_eps_num])&&
    !empty($_GET[title])&&
    !empty($_GET[descrip]))

    {
// Im at a lost how to pull in the data just for test.html&=edit(#), check if a user changed it, then if so update that value in the database

    // Trying to redirect the user back to the list once the update is finished
        header("Location:");
?>

epslist.new.php UPDATED

<?php
require "episodelist.db.php";

//Test for user inout
if (!empty($_POST[season_sum])&&
    !empty($_POST[eps_num])&&
    !empty($_POST[temp_eps_num])&&
    !empty($_POST[title])&&
    !empty($_POST[descrip]))

    {
        $season_sum = mysqlclean($_POST,"season_sum",$link);
        $eps_num = mysqlclean($_POST,"eps_num",$link);
        $temp_eps_num = mysqlclean($_POST,"temp_eps_num",$link);
        $title = mysqlclean($_POST,"title",$link);
        //This is a text area cols 50 rows 7
        $descrip = mysqlclean($_POST,"descrip",$link);
        $ID = mysqlclean($_POST,"id",$link);
    }

    if ( ! empty($_POST['ID']))
    $id = (int)$_POST['ID'];
    else $id = 'NULL';

    //Insert new entry
    $query = "INSERT INTO `season` (`ID`, `season_num`, `temp_eps_num`, `esp_num`, `title`, `descrip`) VALUES ({$id}, '{$season_sum}', '{$eps_num}', '{$temp_eps_num}', '{$title}', '{$descrip}')";

    // Trying to rederect the user back to the list once the update is successfully finished
        header("Location: episodelist_superadmin.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-05-30T16:30:20+00:00Added an answer on May 30, 2026 at 4:30 pm

    I don’t quite understand your question, but I think what you’re asking for is some edit to

    $query="SELECT * FROM `season` WHERE 1";
    

    which should be something like

    $query="SELECT * FROM `season` WHERE `id` = $id";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright I'm a little lost. I've a page that pulls a value out of
I'm very new to Memory Mapped Files, and I'm a little lost on something.
I am a little lost on erros like that: Warning 7 CA2123 : Microsoft.Security
I am little lost at the moment. Hopefully you can point me in the
I'm studying C# Events on this link and am a little lost on when
I have a web app that is being hit by facebook. The login page
A little lost - believe I'm almost there though. I'm trying to make it
I'm a little lost (still working with Ron Jeffries's book). Here's a simple class:
Hi this is pretty basic jQuery stuff but i am a little lost. So
My little site should be pooling list of items from a table using the

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.