Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 17th, 2007, 08:35 PM
luigi7up
Guest
 
Posts: n/a
Default 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

  #2  
Old January 18th, 2007, 02:05 AM
sHacHaosHu
Guest
 
Posts: n/a
Default Re: execution order problem


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

"luigi7up дµÀ£º
"
Quote:
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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles