Jump to content

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


rondog

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.

Archived

This topic is now archived and is closed to further replies.

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