Skip to main content
edited tags
Link
Randi Vertongen
  • 16.5k
  • 4
  • 35
  • 64
added 123 characters in body
Source Link

imI'm trying to print a row from a table in mysql using phpa PHP script - here is the code but its not working show- it shows Bad query apparently there is no issue:

$conn = mysqli_connect($servername, $username, $password, $db); if (!$conn) { die("Connection failed: " . mysqli_connect_error()); }

else{

echo "Connected successfully";

}

$any = "show columns from help_category"; $chk = mysqli_query($any) or die("Bad Query: $sql"); echo""; echo"Type";

while($row = mysqli_fetch_assoc($chk))

{

echo"{$row['Type']}";

}

echo"";

$conn = mysqli_connect($servername, $username, $password, $db);
if (!$conn) {
   die("Connection failed: " . mysqli_connect_error());
}

else{

echo "Connected successfully";

}


$any = "show columns from help_category";
$chk = mysqli_query($any) or die("Bad Query: $sql");
echo"<table border='3'>";
echo"<tr><td>Type</td><tr>";

while($row = mysqli_fetch_assoc($chk))

{

echo"<tr><td>{$row['Type']}</td><tr>";


}


echo"</table>";

im trying to print a row from a table in mysql using php script here is the code but its not working show Bad query apparently there is no issue:

$conn = mysqli_connect($servername, $username, $password, $db); if (!$conn) { die("Connection failed: " . mysqli_connect_error()); }

else{

echo "Connected successfully";

}

$any = "show columns from help_category"; $chk = mysqli_query($any) or die("Bad Query: $sql"); echo""; echo"Type";

while($row = mysqli_fetch_assoc($chk))

{

echo"{$row['Type']}";

}

echo"";

I'm trying to print a row from a table in mysql using a PHP script - here is the code but its not working - it shows Bad query apparently there is no issue:

$conn = mysqli_connect($servername, $username, $password, $db);
if (!$conn) {
   die("Connection failed: " . mysqli_connect_error());
}

else{

echo "Connected successfully";

}


$any = "show columns from help_category";
$chk = mysqli_query($any) or die("Bad Query: $sql");
echo"<table border='3'>";
echo"<tr><td>Type</td><tr>";

while($row = mysqli_fetch_assoc($chk))

{

echo"<tr><td>{$row['Type']}</td><tr>";


}


echo"</table>";
Source Link

viewing a column in mysql database using php script

im trying to print a row from a table in mysql using php script here is the code but its not working show Bad query apparently there is no issue:

$conn = mysqli_connect($servername, $username, $password, $db); if (!$conn) { die("Connection failed: " . mysqli_connect_error()); }

else{

echo "Connected successfully";

}

$any = "show columns from help_category"; $chk = mysqli_query($any) or die("Bad Query: $sql"); echo""; echo"Type";

while($row = mysqli_fetch_assoc($chk))

{

echo"{$row['Type']}";

}

echo"";