Advertisement

09.05.2008 at 06:51PM PDT, ID: 23708121
[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!

8.6

AJAX php mysql cart - different quantity banded prices

Asked by freshwaterwest in PHP and Databases, Asynchronous Javascript and XML (AJAX)

I need to have different unit_price ranges -
i.e.
when quantity = 1 unit_price1
when quantity = 2 unit_price2
when quantity >2 & <5 unit_price4

sort of thing..
attached snippet is my attemptStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
if($quantity == 1) {
      function getItemPrice($order_code) {
	require_once('../Connections/test.php'); 	mysql_select_db($database_nutrition, $nutrition);
	$query_product = "SELECT `unit_price1` FROM products where `order_code` = '" . mysql_real_escape_string($order_code) . "' LIMIT 1";
	$product = mysql_query($query_product) or die(mysql_error());
	$row = mysql_fetch_assoc($product);
	return $row['unit_price1'];
}
}
 
if($quantity == 2) {
      function getItemPrice($order_code) {
	require_once('../Connections/test.php'); 	mysql_select_db($database_nutrition, $nutrition);
	$query_product = "SELECT `unit_price2` FROM products where `order_code` = '" . mysql_real_escape_string($order_code) . "' LIMIT 1";
	$product = mysql_query($query_product) or die(mysql_error());
	$row = mysql_fetch_assoc($product);
	return $row['unit_price2'];
}
}
 
if(($quantity > 2) & ($quantity < 5))  {
      function getItemPrice($order_code) {
	require_once('../Connections/test.php'); 	mysql_select_db($database_nutrition, $nutrition);
	$query_product = "SELECT `unit_price4` FROM products where `order_code` = '" . mysql_real_escape_string($order_code) . "' LIMIT 1";
	$product = mysql_query($query_product) or die(mysql_error());
	$row = mysql_fetch_assoc($product);
	return $row['unit_price4'];
}
}
[+][-]09.05.2008 at 06:55PM PDT, ID: 22405185

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]09.05.2008 at 07:12PM PDT, ID: 22405219

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.05.2008 at 07:23PM PDT, ID: 22405252

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]09.05.2008 at 07:41PM PDT, ID: 22405293

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.05.2008 at 08:00PM PDT, ID: 22405362

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.05.2008 at 09:08PM PDT, ID: 22405767

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]09.06.2008 at 12:28AM PDT, ID: 22406426

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.06.2008 at 06:02AM PDT, ID: 22407303

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]09.06.2008 at 07:27AM PDT, ID: 22407630

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.06.2008 at 01:46PM PDT, ID: 22408917

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]09.07.2008 at 02:53PM PDT, ID: 22413121

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.07.2008 at 03:01PM PDT, ID: 22413143

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.07.2008 at 03:58PM PDT, ID: 22413277

View this solution now by starting your 7-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

Zones: PHP and Databases, Asynchronous Javascript and XML (AJAX)
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.07.2008 at 04:29PM PDT, ID: 22413372

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]09.07.2008 at 04:33PM PDT, ID: 22413389

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]09.07.2008 at 04:42PM PDT, ID: 22413415

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.07.2008 at 06:00PM PDT, ID: 22413667

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_Related_20080208