如何使用switch case从数据库中获取数据?

时间:2013-12-27 05:02:43

标签: javascript switch-statement

以下是示例代码:

function fill_product(i){
var form1 = document.getElementById("form1");
form1.product.options.length=0;
switch(i)
{   

case 0:
form1.product.options[0] =new  Option('**get data from database, like the select                query**');
form1.product.options[1] =new  Option('**get data from database, like the select     query**');

break;

case 1:
form1.product.options[0] =new  Option('**get data from database, like the select     query**',''); 
form1.product.options[1] =new  Option('**get data from database, like the select     query**');
form1.product.options[2] =new  Option('**get data from database, like the select quer**y');

break;

在上面的代码中 - 如何查询和选择数据库中的数据?

0 个答案:

没有答案