php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1450 wrong array size
Submitted: 1999-05-25 10:17 UTC Modified: 1999-06-12 16:56 UTC
From: fcartegn at univ-valenciennes dot fr Assigned:
Status: Closed Package: Dynamic loading
PHP Version: 3.0.8 OS: solaris 2.6
Private report: No CVE-ID: None
 [1999-05-25 10:17 UTC] fcartegn at univ-valenciennes dot fr
this is a function from my class which access sql.
I got only 1 row(of 3 item) in my database but
sizeof($this->$lignes) returns 3 ?!?



function read(){
$conn=mysql_connect("ultraistv8");
if(!mysql_select_db("test",$conn)){echo ("Cannot select database.\n");}

$sql="select * from phptest";
if(!($result=mysql_query($sql,$conn)))
  {
  
  $sql="create table phptest (php char(50), test char(50), login char(50))";
if(!mysql_query($sql,$conn))
  {
  echo ("Error creating test table.\n");
  }else{
  echo ("test table creee<br>");
  } 

  }else{
  $j=0;
  while(($data=mysql_fetch_row($result))){
    $this->$lignes[$j++]=$data;
    }
  } 		
mysql_close($conn);
echo sizeof($this->$lignes);	
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-12 16:56 UTC] jim at cvs dot php dot net
Syntax is wrong. You want $this->lignes.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC