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>";
}
|
 |
 |
klw
|
| Posted: 01/19/2005, 11:22 AM |
|
Try:
$result9 = $db->query(...) instead. 
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
|
 |
 |
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 |
 |
 |
|