PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi there,
I am new to PHP code and to this forum. I am looking forward to a great learning experience. I am expecting that the moderator or other members will guide me if I am posting in the wrong forum. Thank you
Newbie
My Question:
I am not able to understand how sizeOf works. Why is sizeOf($row) equal to 6 instead of 3?
<?php
$conn = mysql_connect("localhost", "x", "y") or die(mysql_error());
mysql_select_db("db1", $conn) or die(mysql_error());
$sql = "
SELECT field1, field2, field3
From testtable1;
";
$result = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_array( $result );
var_dump($row);
PHP Manual wrote:
The type of returned array depends on how result_type is defined. By using MYSQL_BOTH (default), you'll get an array with both associative and number indices.