[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/05/2009 at 01:14PM PST, ID: 24876124
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

UPDATE 3 tables, JOIN on one related record

Asked by yamya in MS SQL Server

Tags: mysql, php, db

In my db are three tables:
products, properties and productPropertyLink

the Link table manages the <strong>many to many relationships</strong>.

the key fields are:
products.productsUID
properties.productUID
productPropertyLink.productUID
productPropertyLink.propertyUID

the workflow is:
select productUID on page 1
pass as $breadcrumb1 to page 2
query WHERE productsUID =$breadcrumb1
set $var for form fields
echo $var into form fields
pass name="name" to page 3
set $var=$_POST['name'];
update  properties record
update products record
insert propertyLink record

All this works just fine if I only pull data from one table.
As soon as I made the Join query, the form does not populate entirely.

In my test record, there are values in all columns.
All of the products.[cols] populate in the form, but only the first three of the properties.[cols] form fields will populate. I cannot see anything different about the way working fields are coded versus empty fields are coded.

THis all worked fine when there was only one table pulling into the form fields.

All ideas welcome!

Thanks so much.
Amy
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
//Here is the SELECT query that JOINs two tables: 
$query="SELECT products.productsUID, products.productName, products.productSKU, products.agrossi_LabID, products.ProdNextStep, products.yourName, properties.propertiesUID, properties.length, properties.width, properties.diameter, properties.cureTime, properties.viscosity, properties.handleTime, properties.fixtureTime, properties.gapFill, properties.batchNumber, properties.batchNotes, properties.tempC, properties.tempF, properties.tensile, properties.shear, properties.peel 
FROM products, properties 
WHERE properties.productUID = '$breadcrumb1' ORDER BY products.productsUID ASC LIMIT 1";  
//deal with the query results 
$result = mysql_query($query) or die(mysql_error());  
$num=mysql_num_rows($result);
$i=0;
while ($i < $num) {  
// Here is example of how the $var are set: 
$ProdNextStep=mysql_result($result,$i,"products.ProdNextStep");
$yourName=mysql_result($result,$i,"products.yourName");
$tempC=mysql_result($result,$i,"properties.tempC");
$tempF=mysql_result($result,$i,"properties.tempF");
$tensile=mysql_result($result,$i,"properties.tensile"); 
//The first three echo statements work.length, width, diameter
//The second three echo statements do NOT work. 
//The values are all passed to page 3 and INSERT or UPDATE //queries work as expected.
<p class=inputF>Length: <br /><input name="length" type="text" value="<?php echo " $length "; ?>"/></p>
<p class=inputF>Width: <br /><input name="width" type="text" value="<?php echo " $width "; ?>"/></p>
<p class=inputF>Diameter: <br /><input name="diameter" type="text" value="<?php echo " $diameter "; ?>"/></p>
<p class=inputF>CureTime: <br /><input name="cureTime" type="text" value="<?php echo " $cureTime"; ?>"/></p>
<p class=inputF>Viscosity:<br /> <input name="viscosity" type="text" value="<?php echo " $viscosity"; ?>"/></p>
<p class=inputF>Handle Time: <br /><input name="handleTime" type="text" value="<?php echo " $handleTime"; ?>"/></p>
[+][-]11/05/09 01:22 PM, ID: 25754182

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/05/09 02:14 PM, ID: 25754645

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: mysql, php, db
Sign Up Now!
Solution Provided By: aneeshattingal
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625