I am trying to print username, password and name from the database but it does not print anything. Please guide me. Thanks.
<?php
$con=mysqli_connect("localhost","xxxxxx","xxxxx","xxxxx");
// Check connection
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM xxxx");
var_dump($result);
if (!$result) {
echo "<p>There was an error</p>";
echo $mysqli->error;
}
while($row = mysqli_fetch_array($result))
{
if ((isset($_GET['id'])))
{
echo "id is ".$_GET['id'];
echo "<br> username is ".$result->user_id;
echo "<br> password is ".$result->password;
echo "<br> password is ".$result->name;
}
else
{
echo "<br> enter id in parameter";
}
}
mysqli_close($con);
?>
Here is my php.ini:
; any text on a line after an unquoted semicolon (;) is ignored
[php] ; section markers (text within square brackets) are also ignored
; Boolean values can be set to either:
; true, on, yes
; or false, off, no, none
register_globals = off
track_errors = yes
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
; you can enclose strings in double-quotes
include_path = ".:/usr/local/lib/php"
; backslashes are treated the same as any other character
include_path = ".;c:\php\lib"
It is being loaded well but still I do see error messages printed. Thanks.