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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:12:49+00:00 2026-06-15T04:12:49+00:00

I’m trying to create a backpanel to my TV project. My MySql database consists

  • 0

I’m trying to create a backpanel to my TV project. My MySql database consists of two tables. “Shows” & “Seasons”.

The Shows table consists of the Show ID (Primary Key), Show Title & date. The Seasons table consists of Season ID (Primary Key), Show ID (Foreign Key), Season, release date.

The first thing you see in the control panel is all the shows from the database in table format. For instance if you edit “Dexter” it will bring you to the edit page showing input boxes for the seasons of dexter. Like Season 1,Season 2 etc… I have this sort of working. By that i mean it displays properly in input boxes but when i go to submit it just redirects back to the same edit page and nothing gets updated.

The Code from my main index.php backpanel that allows you to edit:

<td><a href="edit.php?id=<?php echo $row['show_id']; ?>">edit</a></td>

Code from edit.php:

<?php
$playlist_id=$_GET['id'];
// this makes it so it grabs the season records that match the show id
$sql="SELECT * FROM seasons WHERE show_id='$show_id'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
?>



<table>
<form name="form1" method="post" action="">
<tr>
<td>
<table>
<tr>
<td align="center"><strong>Id</strong></td>
<td align="center"><strong>Season Name</strong></td>
</tr>

<?php
while($rows=mysql_fetch_array($result)){
?>

<tr>
<td align="center">
<input name="season_id[]" type="text" id="season_id" value="<?php echo $rows['season_id']; ?>">
</td>
<td align="center">
<input name="Season[]" type="text" id="Season" value="<?php echo $rows['Season']; ?>">
</td>
</tr>

<?php
}
?>

<tr>
<td></td>
<td></td>
<td colspan="4" align="right"><input type="Submit" name="Submit" value="Submit"></td>
</tr>
</table>
</td>
</tr>
</form>
</table>

<?php

$result1 = FALSE;
if (isset($_GET['Submit'])) {
for($i=0;$i<$count;$i++){
$sql1="UPDATE seasons SET Season='$Season[$i] WHERE Season_id='$Season_id[$i]'";
$result1=mysql_query($sql1);
}
}

if($result1){
header("location:update.php");
}
mysql_close();
?>

You are probably wondering why would i want to edit the name of the seasons but i will eventually make it more complicated and add more fields once i get past this hurdle. Like i said it displays properly but when i hit submit it just reloads the page and nothing changes.

  • 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-15T04:12:50+00:00Added an answer on June 15, 2026 at 4:12 am

    You are posting data, so you need to change this isset($_GET[‘Submit’]) to isset($_POST[‘Submit’])

    You have error in update query. Missing ‘ after $Season[$i]

    $sql1=”UPDATE seasons SET Season=’$Season[$i]’ WHERE Season_id=’$Season_id[$i]'”;

    You can use mysql_affected_rows() to check if row has updated.

    if(mysql_affected_rows() == 1){
    echo "Updated";
    } else { echo "error"; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to create an if statement in PHP that prevents a single post
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
I am trying to render a haml file in a javascript response like so:

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.