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

Posted on 2011-04-26
Last Modified: 2012-05-11
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?
Question by:iamdiggnified
    LVL 107

    Accepted Solution

    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.

    Author Comment

    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?
    LVL 107

    Expert Comment

    by:Ray Paseur
    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.
    LVL 1

    Expert Comment

    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.

    Author Comment

    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.
    LVL 107

    Expert Comment

    by:Ray Paseur
    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.

    Author Comment

    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.
    $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;';
    if ($producttype=='Cedar Board on Board Panels')
    if ($producttype=='Cedar Solid Panels')
    if ($producttype=='Cedar Spaced Picket Panels')
    if ($producttype=='Curved Top Cedar Solid Panels')
    if ($producttype=='Good Neighbor Fence Panels')
    if ($producttype=='Cedar Arbors')
    if ($producttype=='Fence Toppers')
    if ($producttype=='Vinyl Arbors')
    if ($producttype=='Vinyl Gates')
    if ($producttype=='Vinyl Privacy Panels')
    if ($producttype=='Vinyl Semi Privacy Panels')
    if ($producttype=='Vinyl Victorian Square Picket')
    if ($producttype=='Vinyl Through The Rail Spaced Picket')
    if ($producttype=='Vinyl Traditional Spaced Picket')
    if ($producttype=='Vinyl Post Caps And Hardware')
    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/'; 
    $query = "select item_extension.sort, item_extension.number, item_extension.size,, 
    item_extension.code, item_extension.pic, item.item_desc as descript, item_extension.descript2, item_extension.descript3, keywordgroup.keywords,, 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>';
    if ($producttype!='')
    echo '<br />Email <a href="">Rick EXT. 7516</a> or <a href="">Jim EXT. 7502</a> with further questions.';

    Open in new window


    Author Comment

    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".
    //--------------------------------------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
    	$result = mysql_query($query);
    	$num_results = mysql_num_rows($result);
    	//echo '<H4>'.$producttype.'</H4>';
     	if (($num_results==0) &&($producttype!=''))
    		echo 'No items found...<BR>';
    		//echo $num_results.' items found...';
    		echo '<TABLE class=qb >';
    		for ($i=0; $i <$num_results; $i++)
    				$row = mysql_fetch_array($result);
    				if ($number=='')
    				if (($page=='') ||($page==0))
    				if (($code!='')&&($code!='KIT'))
    				else if ($code=='')
    					$item_pum='<FONT COLOR=RED>Spec Order</FONT>';
    				else if ($code=='KIT')
    					$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>';
    		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>';
    		else //otherwise------------------------------------------------------------------------------------------
    			echo '<TABLE width="'.$ttblwidth.'" class=qb><TR>';
    		} //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


    Author Comment

    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?
    LVL 107

    Expert Comment

    by:Ray Paseur
    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?

    Author Comment

    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?

    Author Closing Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to dynamically set the form action using jQuery.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now