ajax array php

Get help using Construct 2

Post » Wed Sep 14, 2016 7:23 pm

one question.
if i have another count of table rows, how i must change array size? i mean, on which parameters does array size is based?
4 - width ? (meaning 4 table rows?)
2 - height ? (what does it mean?)
1-depth ? (what for?)
is it 2d or 3d array?
The whole life is in the movement.Stopped - fell asleep to hell...
B
14
S
3
G
1
Posts: 122
Reputation: 1,694

Post » Wed Sep 14, 2016 8:39 pm

Array
manual wrote:Array properties
Width (X dimension)
Height (Y dimension)
Depth (Z dimension)

The size of the array. If you want a one-dimensional array (i.e. a list of values), use A x 1 x 1. If you want a two-dimensional array (i.e. a grid of values) use A x B x 1.

in c2 is necessary to determine all three dimensions
Image
....................
Table Persons
Image
C2 Array
Image

so..PHP script transform Rows to Columns & columns2rows.. :?
Code: Select all
$size = array(4,2,1);

in this case
$size = array(Rows(4),Columns(userName&userContact),1);


php script to check $size
Code: Select all
<?php
$servername = "yourServerName.com";
$username = "yourUserName";
$password = "yourPassword";
$dbname = "yourDatabaseName";


$conn = new mysqli($servername, $username, $password, $dbname);

        if ($conn->connect_error)
        {
        die("Connection failed: " . $conn->connect_error);
          }

$sql="SELECT * FROM Persons ";

if ($result=mysqli_query($conn,$sql))
  {
 
  $rowcount=mysqli_num_rows($result);
  $columncount=mysqli_num_fields($result);
            $size=( 'array('.$rowcount. ',' .$columncount.',1)' ) ;
            echo($size);
 
            mysqli_free_result($result);
  }

mysqli_close($conn);
exit();
?>
B
66
S
24
G
7
Posts: 1,514
Reputation: 11,039

Previous

Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider] and 43 guests