How to create JS array from 1 to n

QuestionsHow to create JS array from 1 to n
c3media asked 6 years ago

Hello Abu,

 

Finally to performance in project, there are three cols: Id – name – quantity (9 for example).

Then i would like to use select form in line grid to generate array from one to n quantity in DB table column.

As this: http://jsfiddle.net/3kcvm/

 

Thank you

3 Answers
Abu Ghufran Staff answered 6 years ago

Please share screenshot explaining your question. I don’t understand your query completely.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
c3media answered 6 years ago

For example, this work for pure PHP, how to implement it in phpgrid:

$con = new mysqli("localhost","*****","","******");
$sql = "select * from person";
$query = $con->query($sql);
$data = array();
while($r=$query->fetch_object()){
$data[] =$r;
}

Abu Ghufran Staff answered 6 years ago

You can refer

Code: http://phpgrid.org/demo/demos/loading/load-array.phps

It uses php array to load datagrid.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

8 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?