If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > help with a argument

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-12-10, 21:38
markrday markrday is offline
Registered User
 
Join Date: Jul 2010
Posts: 2
help with a argument

im currently showing a list of stock 4 or 5 fields , the last is a stock indicator which shows either 1 or 0

my problem is getting the list to show either only items marked 1 or only items marked 0

its controlled by a list.xml can anyone help me with the syntax

im hoping to make 2 list.xml files one only showing items marked as 0
and one showing items marked as 1

can any of you guys help

<form>

<title>Products List</title>
<border>true</border>
<width>800</width>

<fields>
<_count header="No" suffix="." width="25" align="center" />
<product_vendor type="relation" align="center" header="Location">
<relation table="vendors" id="vendor_id" text="vendor_name" />
</product_vendor>
<product_name align="center" header="Item Name" />
<product_number align="center" header="Serial Number" />
<product_acrylic align="center" header="Colour" />
<product_cab align="center" header="Cab Colour" />
<product_count align="center" type="sql" header="Stock Level">


<sql>
<vars>
<table import="$this->tables[transactions]" type="eval" />
<product import="product_id" type="field" />

</vars>

<query>SELECT sum(trans_inventory) FROM {TABLE} WHERE trans_product='{PRODUCT}'</query>
<field>sum(trans_inventory)</field>
</sql>

</product_count>


</fields>

<header>
<titles>true</titles>

<buttons>
</buttons>
</header>

<buttons>

<details onclick="" button="details" >
<location>index.php?sub=products&action=details&se ction=1&product_id={PRODUCT_ID}&returnurl={CURRENT _PAGE}</location>
</details>

</buttons>

<items>50</items>

</form>

thank you guys

mark
Reply With Quote
  #2 (permalink)  
Old 07-12-10, 21:52
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
Get rid of the miscellaneous code and show the sql code only, then worry about adding your application code later.

why not merely get all records and order them by the stock indicator column?
Reply With Quote
  #3 (permalink)  
Old 07-12-10, 22:00
markrday markrday is offline
Registered User
 
Join Date: Jul 2010
Posts: 2
Thanks for getting back to me do you only need to see the section that controls the list.XML or the table/ field layout

Sorry I'm very new to this picking it up fast but really new and find myself running before I even start crawling

What you said about getting them to order by stock sounds the best way yes

Mark
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On