473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

execution order problem

Hello to everyone...
I'm having a little problem with displaying a number of products in my
shoping cart that I'm writing from scratch.
The structure of a site is following: INDEX.php is my main page where
everything else loads up. So, my shop component comes as
index.php?kom=shop and a little switch($kom) in at the begining of
index.php switches the main content. That content, in this case shop
component, loads into <div id='mainContent'>include ('$content')</div>.

Every activity of shop component runs by sending task variable through
URL to itself where another SWITCH is. So, to add something to cart I
do index.php?kom=shop&task=add and it's added. It gets
$_POST['prod_id'] and component does function that runs SQL query
according to task=add.
I also have a little "module", in index.php, that says: "Number of
prod. in cart is :14". It is put directly into index.php so that it
could be seen no mater which component is loaded. Because of design of
a page this module is situated before the content of components that
are loaded.
My problem is that this module runs it's SQL query and gets number of
products in cart before the component shop runs insert function. So in
komponent shop I will have real situation from database but in my
module I'll have number of products that is not up-to date. I have
to refresh page so that cart module runs it's query again and gets real
numbers...
Do you have any idea how to get my cart module run after insert has
been done yet presented in HTML before shop component

Jan 17 '07 #1
1 1658

sounds like something similar to Joomla or Mambo.
since the component is the many part of an action, why not execute it
first.

"luigi7up дµÀ£º
"
Hello to everyone...
I'm having a little problem with displaying a number of products in my
shoping cart that I'm writing from scratch.
The structure of a site is following: INDEX.php is my main page where
everything else loads up. So, my shop component comes as
index.php?kom=shop and a little switch($kom) in at the begining of
index.php switches the main content. That content, in this case shop
component, loads into <div id='mainContent'>include ('$content')</div>.

Every activity of shop component runs by sending task variable through
URL to itself where another SWITCH is. So, to add something to cart I
do index.php?kom=shop&task=add and it's added. It gets
$_POST['prod_id'] and component does function that runs SQL query
according to task=add.
I also have a little "module", in index.php, that says: "Number of
prod. in cart is :14". It is put directly into index.php so that it
could be seen no mater which component is loaded. Because of design of
a page this module is situated before the content of components that
are loaded.
My problem is that this module runs it's SQL query and gets number of
products in cart before the component shop runs insert function. So in
komponent shop I will have real situation from database but in my
module I'll have number of products that is not up-to date. I have
to refresh page so that cart module runs it's query again and gets real
numbers...
Do you have any idea how to get my cart module run after insert has
been done yet presented in HTML before shop component
Jan 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: z. f. | last post by:
Hi, i have a class that is derived from System.Web.UI.Page, and this is the class i use in my application as PageBase. all other page classes are deriverd from my PageBase instead of the...
23
by: roman | last post by:
Hi, I would like to have two actions for one event. But I want the second action to trigger when the first one action completes. Is it possible to do this in javascript? I'm using the onclick...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.