CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Handcode to Css List box Problem

Print topic Send  topic

Author Message
dynamiconcepts

Posts: 17
Posted: 01/19/2005, 11:13 AM

I have a list box I have tried every way you can think of to get my custom hand code to work and its just no working here is my code works fine hand coded but wont worl with ccs I used the BeforeExecuteSelect event.

global $downloads;
$result9 = $db->sql_query("SELECT category_id, category_name, category_parent_id from " . $prefix . "downloads_categories order by category_name");
echo "" category ": <select name=\"category_Name\">";
while($row9 = $db->sql_fetchrow($result9)) {
$category_id2 = intval($row9['category_id']);
$category_name2 = $row9['category_name'];
$category_parent_id2 = intval($row9['category_parent_id']);
if ($category_parent_id2!=0) $category_name2=getparent($category_parent_id2,$category_name2);
echo "<option value=\"$category_id2\">$category_name2</option>";
}
View profile  Send private message
klw
Posted: 01/19/2005, 11:22 AM

Try:
$result9 = $db->query(...) instead. 8-)

Quote dynamiconcepts:
I have a list box I have tried every way you can think of to get my custom hand code to work and its just no working here is my code works fine hand coded but wont worl with ccs I used the BeforeExecuteSelect event.

global $downloads;
$result9 = $db->sql_query("SELECT category_id, category_name, category_parent_id from " . $prefix . "downloads_categories order by category_name");
echo "" category ": <select name=\"category_Name\">";
while($row9 = $db->sql_fetchrow($result9)) {
$category_id2 = intval($row9['category_id']);
$category_name2 = $row9['category_name'];
$category_parent_id2 = intval($row9['category_parent_id']);
if ($category_parent_id2!=0) $category_name2=getparent($category_parent_id2,$category_name2);
echo "<option value=\"$category_id2\">$category_name2</option>";
}
dynamiconcepts

Posts: 17
Posted: 01/19/2005, 11:28 AM

Nope didnt work either
View profile  Send private message
Nicole

Posts: 586
Posted: 01/20/2005, 2:41 AM

Hello,
As I understand you want to fill CCS Listbox with values from custom SQL. If so you can select SQL Data Source Type and put your SQL as data source. If you prefer to do it via custom code use Before Show event of a listbox. Here is sample code:
  
global $ListBox1;  
$db = new clsDBconnection_name();  
  
$SQL = "your query";  
$Where ="Where clause - optional";  
$Order = "order by  - optional";  
$BoundCol = "bound_column_name";  
$TextCol = "text_column_name";  
$ListBox1->Values = CCGetListValues($db, $SQL, $Where, $Order, $BoundCol, $TextCol);  

_________________
Regards,
Nicole
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.