Jump to content

[SOLVED] UPDATE statement not echoing out correct results until refresh


Recommended Posts

I have a video.php page that a user is able to input client, title, location description, ect into a text field. When you hit submit, it reloads the page, but has the previous results. So the UPDATE statement is working, its just not outputting the correct changes. Here is my php

<?php
include 'connect.php';
$flashurl = $_GET['vid'];
$c_loc = $_GET['cam'];
$t_loc = $_GET['tape'];
$filename = str_replace("cam_$c_loc/tape_$t_loc/","","$flashurl");
$capCam = strtoupper($c_loc);
$vidcall = "$filename.flv";
$curP = $_SERVER['PHP_SELF'];
$submiturl = "$curP?vid=$flashurl&cam=$c_loc&tape=$t_loc";
//show results already in the DB
$query = mysql_query("SELECT client,title,segtitle,location,dateshot,rights,keywords FROM videos WHERE vidname = '$vidcall'") or die(mysql_error());
$row = mysql_fetch_row($query) or die(mysql_error());

$submit = $_POST['Submit'];
$client = $_POST['client'];
$title = $_POST['title'];
$segtitle = $_POST['segement'];
$location = $_POST['location'];
$date = $_POST['date'];
$rights = $_POST['rights'];
$searchtags = $_POST['searchtags'];
if($submit != "" ) {
$query = mysql_query("UPDATE videos SET client = '$client', title = '$title', segtitle = '$segtitle', location = '$location', dateshot = '$date', rights = '$rights', keywords = '$searchtags' WHERE vidname = '$vidcall'") or die(mysql_Error());
}
?>

 

I thought that if I do it the way I currently have it setup it, you hit submit it sends the new results, the page comes up again and selects the new results. Thats not the case however. How could I just submit and output the results they just entered? thanks.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.