got trouble connection to mysql5 using php5...need help

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
my environment:
-php ver 5.2.0
-mysql 5
-windows xp
-apache 2
-all of these are on the same machine

my code:

echo "browsing users";

$conn=new mysqli("localhost","dba","masterkey","tms");
 echo "Connection Error";

$query="select username from reg_user";

echo "<p>num of records found: ".$num_results."</p>";

for($i=0; $i<$num_results; $i++){
 echo "<br/> Username: ";
 echo stripslashes($row['username']);


-if i run the code the only thing that shows is "browsing users".
-this line >> echo "<p>num of records found: ".$num_results."</p>";  <<
is not also showing up
-is there something wrong with my code...logic..or syntax?
-or i wasnt able to obtain communication with mysql that's why nothing
appears. and if so, what have gone wrong why i cannot to mysql?

Re: got trouble connection to mysql5 using php5...need help wrote:

Quoted text here. Click to load it

Which Database abstraction layer are you using?

$conn=new mysqli("localhost","dba","masterkey","tms");
is only valid if some classdefinition of mysqli exists.

And did you try to connect to the database without the abstractionlayer?
Also check if you updated your php.ini so it uses mysqli.dll instead of  
In such cases I always check first if things connect succesfull by using php  
native commands first before using the abstractionlayer.

Erwin Moller

Site Timeline