CODE
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("hello", $con);
$result = mysql_query("SELECT * FROM world where name = 'test'");
while($row = mysql_fetch_array($result))
{
echo $row['name'];
echo "<br />";
}
?>
this code outputs
test
Q: how i can add css style on that output?is it the way?
CODE
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("hello", $con);
?>
<html>
<body>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<?php
$result = mysql_query("SELECT * FROM world where name = 'test'");
while($row = mysql_fetch_array($result))
{
echo "<div id = 'php'>";
echo "Your name is " . $row['name'];
echo "</div>";
}
?> .
</body>
</html>
i want better solution or perfect solution......