[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

How do I get an update I made to a record in my database show up on the Web page?

Our company hosts their intranet on an in-house server. I just updated a database record in phpmyadmin but the change is not showing up when I refresh my browser. How do I refresh the files to make the change show up? Its important to note that in another database table on our intranet, whenever I make a database change I click a link which activates a script which refreshes the data. However in the database record I just updated it is not connected to the same refresh script. Is there another way for me to refresh the database record I just updated?
0
iamdiggnified
Asked:
iamdiggnified
  • 7
  • 4
1 Solution
 
Ray PaseurCommented:
There are a lot of things that might be wrong.  Your servers might be cache-ing the data.  Your browser might be cache-ing the server response.  Your updates might have been made against the wrong table.  Your file paths might be incorrect.  Any one or any combination of these could be in play.
0
 
iamdiggnifiedAuthor Commented:
Thanks Ray. I think since other tables have a script that was created which refreshes the records means that the table I'm working on needs one too. Unless their is a manual way for me to update it. I'm pretty sure I have updated the right table. And the paths are correct as all i changed was a price of a record that was already in place on the web site. I don't think its a browser caching issue as i empty my browser cache and hit ctrl + refresh and the old price of the record is still there. So do you now how I would go about fixing if the servers are caching the new data?
0
 
Ray PaseurCommented:
Do you have a server admin there?  If so ask her about it.  It's the sort of thing that might have come up before.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
AnuarJamlusCommented:
Do you know if the page that you're browsing is actually pulling data from the table where you updated the record? Sometimes there are several tables involved and there may be additional tables where the data has not been updated. Hence the need for a script to "refresh" the data.
0
 
iamdiggnifiedAuthor Commented:
Anuar, I think there are several tables as you suggest. The page itself has this link: <a href="fencing.php?PRODUCTTYPE=Fence Toppers"><Strong>Fence Toppers</Strong>

When someone clicks on Fence Toppers, all the fence toppers products from the database show up in a list at the bottom of the page. The "fence toppers" is a record entry in a table called "item_extension". However the prices (which is what i'm trying to update in my pages) for the all fence topper products are located in a table called "products".

The page code of the a href tag above accesses the item_extension table but I can't find anywhere else on the page or other linked pages off that page that has code telling the table "item_extension" to get its price from the table "products". Yet it must because there is no other table where the price is listed.

Do I need to add a refresh script to get the price change to update on the page? If so, do you know of any ready-made scripts I can use? Thank you.
0
 
Ray PaseurCommented:
any ready-made scripts I can use?

Some questions come to mind... Who developed the web site?  Can you get them to show you how they joined the tables?  Can you determine if it was developed in a standard shopping cart (most of them provide ways to change prices)?  Can you post a URL link to the web pages in question along with the source code and the CREATE TABLE statements.  Any of those answers will be helpful as you try to reduce this question to something that can have an answer that represents a solution instead of a speculation.
0
 
iamdiggnifiedAuthor Commented:
Ray, I realize its tough to come up with an answer when you don't have all the info. sorry for that. I've attached the main page code below.
<?php

$varredarrow='<img src="../../graphics/redarrow.jpg" width="15" height="8" border="0">&nbsp;&nbsp;&nbsp;';
$varwhitearrow='<img src="../../graphics/whitearrow.jpg" width="15" height="8" border="0">&nbsp;&nbsp;&nbsp;';

require('../../include/connectdb.inc');
$producttype=$_GET['PRODUCTTYPE'];
$cobbp=$varwhitearrow;
$csp=$varwhitearrow;
$cspp=$varwhitearrow;
$ctcsp=$varwhitearrow;
$gnfp=$varwhitearrow;
$ca=$varwhitearrow;
$ft=$varwhitearrow;
$va=$varwhitearrow;
$vg=$varwhitearrow;
$vpp=$varwhitearrow;
$vspp=$varwhitearrow;
$vvsp=$varwhitearrow;
$vttrsp=$varwhitearrow;
$vtsp=$varwhitearrow;
$vpch=$varwhitearrow;
if ($producttype=='Cedar Board on Board Panels')
	$cobbp=$varredarrow;
if ($producttype=='Cedar Solid Panels')
	$csp=$varredarrow;
if ($producttype=='Cedar Spaced Picket Panels')
	$cspp=$varredarrow;
if ($producttype=='Curved Top Cedar Solid Panels')
	$ctcsp=$varredarrow;
if ($producttype=='Good Neighbor Fence Panels')
	$gnfp=$varredarrow;
if ($producttype=='Cedar Arbors')
	$ca=$varredarrow;
if ($producttype=='Fence Toppers')
	$ft=$varredarrow;
if ($producttype=='Vinyl Arbors')
	$va=$varredarrow;
if ($producttype=='Vinyl Gates')
	$vg=$varredarrow;
if ($producttype=='Vinyl Privacy Panels')
	$vpp=$varredarrow;
if ($producttype=='Vinyl Semi Privacy Panels')
	$vspp=$varredarrow;
if ($producttype=='Vinyl Victorian Square Picket')
	$vvsp=$varredarrow;
if ($producttype=='Vinyl Through The Rail Spaced Picket')
	$vttrsp=$varredarrow;
if ($producttype=='Vinyl Traditional Spaced Picket')
	$vtsp=$varredarrow;
if ($producttype=='Vinyl Post Caps And Hardware')
	$vpch=$varredarrow;
echo '<table width=650 class=qb border="0"><tr align=middle ><td valign=top>';
	echo '<table class=qb border="0"><tr>';
	echo '<tr><td width=15 align=right valign=top>'.$cobbp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Cedar Board on Board Panels"><Strong>Cedar Board on Board Panels</Strong></a></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$ctcsp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Curved Top Cedar Solid Panels"><Strong>Curved Top Cedar Solid Panels</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$ca.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Cedar Arbors"><Strong>Cedar Arbors</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$vpp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Vinyl Privacy Panels"><Strong>Vinyl Privacy Panels</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$vttrsp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Vinyl Through The Rail Spaced Picket"><Strong>Vinyl Through The Rail Spaced Picket</Strong></td></tr>';
	echo '</table>';
echo '</td>';
echo '<td valign=top>';
	echo '<table class=qb border="0"><tr>';
	echo '<tr><td width=15 align=right valign=top>'.$csp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Cedar Solid Panels"><Strong>Cedar Solid Panels</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$ft.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Fence Toppers"><Strong>Fence Toppers</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$vg.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Vinyl Gates"><Strong>Vinyl Gates</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$vspp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Vinyl Semi Privacy Panels"><Strong>Vinyl Semi Privacy Panels</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$vtsp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Vinyl Traditional Spaced Picket"><Strong>Vinyl Traditional Spaced Picket</Strong></td></tr>';
	echo '</table>';
echo '</td>';
echo '<td valign=top>';
	echo '<table class=qb border="0"><tr>';
	echo '<tr><td width=15 align=right valign=top>'.$cspp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Cedar Spaced Picket Panels"><Strong>Cedar Spaced Picket Panels</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$gnfp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Good Neighbor Fence Panels"><Strong>Good Neighbor Fence Panels</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$va.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Vinyl Arbors"><Strong>Vinyl Arbors</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$vvsp.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Vinyl Victorian Square Picket"><Strong>Vinyl Victorian Square Picket</Strong></td></tr>';
	echo '<tr><td width=15 align=right valign=top>'.$vpch.'</td> <td ><a href="fencing.php?PRODUCTTYPE=Vinyl Post Caps And Hardware"><Strong>Vinyl Post Caps And Hardware</Strong></td></tr>';
	echo '</table>';
echo '</td></tr></table>';

//$path='fencing/Cedar Board on Board  Panels1_files/'; 
$path='fencing/'.$producttype.'1_files/'; 
$query = "select item_extension.sort, item_extension.number, item_extension.size, item_extension.page, 
item_extension.code, item_extension.pic, item.item_desc as descript, item_extension.descript2, item_extension.descript3, keywordgroup.keywords, 
item_extension.link, item_extension.type, item_extension.length, item_extension.sellprice, format(inventory.inv_price2,2) 
as inv_price2, item.item_pum from item_extension 
left join keywordgroup on item_extension.item_id=keywordgroup.item_id 
left join item on item_extension.code=item.item_cd 
left join inventory on item.item_id=inventory.item_id and item_extension.loc_id=inventory.loc_id  
where item_extension.type='$producttype' order by  item_extension.sort, item_extension.descript2, item_extension.size";

echo '<BR>';
require('./listextensionfencing.php');

if ($producttype!='')
echo '<br />Email <a href="mailto:zzz@bbb.com">Rick EXT. 7516</a> or <a href="mailto:aaa@bbb.com">Jim EXT. 7502</a> with further questions.';

?>
<BR>

Open in new window

0
 
iamdiggnifiedAuthor Commented:
Ray, below is another page of code linked off the main page code I just sent you. What happens is the code above lists types of products on a page. When someone clicks on the link of a product it opens up to a list of items under that product but still on the same page. That sublist is activated by the code below and is where the price point is that i'm trying to update. I am not sure as to how the price point which is found in the table "products" is tied to the related table "item_extension".
<?php
//--------------------------------------Fixed width columns
//	$nwidth='50';	//number width
//	$dwidth='180'; //description width
//	$swidth='120';	//size width
//	$cwidth='30';	//code width
//	$twidth='50';	//type width

//--------------------------------------Variable width columns

	$nwidth='10';	//number or page width
	$dwidth='350'; //description width
	$swidth='50';	//size width
	$cwidth='40';	//code width
	$twidth='10';	//type width
	$pwidth='30';	//price width
	$lwidth='0';	//length width
	$pumwidth='60';	//pum width
	$pagenumwidth='60';	//page & number width
	$ttblwidth='350';	//top line table width width
	$btblwidth='350';	//bottom line table width width
	$spacewidth='20';	//bottom line table width width
	$keywordswidth='0';	//pum width
	$producttype=$_GET['PRODUCTTYPE'];

	$result = mysql_query($query);
	$num_results = mysql_num_rows($result);
	//echo '<H4>'.$producttype.'</H4>';
 	if (($num_results==0) &&($producttype!=''))
		echo 'No items found...<BR>';
	else
	{
		//echo $num_results.' items found...';
		echo '<TABLE class=qb >';
		$priorpic='';
		for ($i=0; $i <$num_results; $i++)
		{
				$row = mysql_fetch_array($result);
				$code=(stripslashes($row['code']));
				$vendor=(stripslashes($row['vendor']));
				$vendorcode=(stripslashes($row['vendorcode']));
				$number=(stripslashes($row['number']));
				$page=(stripslashes($row['page']));
				$pic=(stripslashes($row['pic']));
				if ($number=='')
					$number='--';
				if (($page=='') ||($page==0))
					$page='--';
				$size=(stripslashes($row['size']));
				$length=(stripslashes($row['length']));
				$descript=(stripslashes($row['descript']));
				$descript2=(stripslashes($row['descript2']));
				$descript3=(stripslashes($row['descript3']));
				$keywords=(stripslashes($row['keywords']));
				$link=(stripslashes($row['link']));
				$type='';
				$sellprice=(stripslashes($row['sellprice']));
				$price2=(stripslashes($row['inv_price2']));
				if (($code!='')&&($code!='KIT'))
				{
					$priceprint=$price2;
					$item_pum=(stripslashes($row['item_pum']));
				}
				else if ($code=='')
				{
					$priceprint=$sellprice;
					$item_pum='<FONT COLOR=RED>Spec Order</FONT>';
				
				}
				else if ($code=='KIT')
				{
					$priceprint=$sellprice;
					$item_pum='<FONT COLOR=RED>Parts in Stock</FONT>';
				
				}

		if (($pic!=$priorpic) && ($priorpic=='')) //if pic changes and prior pic is null (beginning of report)------------------------------
		{						
			echo '<TR><TD>	<H4>'.$producttype.'</H4><TABLE width="'.$ttblwidth.'" class=qb>';
			echo '<TR>';
			require('displaystuff.php');
		}
		elseif (($pic!=$priorpic) && ($priorpic!=''))//if pic changes and prior pic is NOT null------------------------------
		{						
			echo '</TABLE></td><TD valign=top><img src="'.$path.$priorpic.'"></td></TR>';
			echo '<tr>';
			echo '<td>&nbsp;</td>';
			echo '</tr><TR>';
			echo '<TD>	<H4>'.$producttype.'</H4><TABLE width="'.$ttblwidth.'" class=qb>';
			echo '<TR>';
			require('displaystuff.php');
		}
		else //otherwise------------------------------------------------------------------------------------------
		{
			echo '<TABLE width="'.$ttblwidth.'" class=qb><TR>';
			require('displaystuff.php');
		}
		$priorpic=$pic;

			
		} //end of for loop
			if ($producttype!='')
				echo '</TABLE></td><TD valign=top><img src="'.$path.$priorpic.'"></td></TR>';
		echo '</TABLE>';
	} //end of else
?>

Open in new window

0
 
iamdiggnifiedAuthor Commented:
Ray, I've also attached a snapshot of the database tables that are used for this. I have access to phpmyadmin. Can that be used to show you how the tables are joined?
fencing-database-refresh-problem.gif
0
 
Ray PaseurCommented:
I wonder if there is another table somewhere?  Maybe a junction table that joins these two tables in a many-to-many relationship?  Or maybe item_extension.code = products.sku?
0
 
iamdiggnifiedAuthor Commented:
Can we assume that the tables are joined and that I need a refresh script to update the data on the web page itself? Is there a script I can download?
0
 
iamdiggnifiedAuthor Commented:
Ray, it appears that your suggestion that i altered the wrong table was right after all. My boss helped me to search through to the correct table.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now