Forum Moderators: not2easy
Could anyone tell me how to addjust my result to the top(10% away from the top)? please.
I try to use margin-top:10%, but it does not work.
Please go to my website http://www.businessfind101.com/, and type the sentence with "MySql YourSql" into search function, you will see the result in the button, i have not idea to move them up.
and my code as following;
php
session_start();
$aString=$_REQUEST["SText"];
$_SESSION["aString"]=$aString;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
</head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
[b]table.display{margin-top:10%}[/b]
</style>
<body>
<?php
$con = mysql_connect("localhost", "#*$!","1#*$!");
if (! $con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("#*$!x", $con);
$result = mysql_query("select * from Customer2");
// was it a success
if (!$result)
die ("Error processing request - check your query");
// process results
$nrecs = mysql_num_rows($result);
/* Use tab and newline as tokenizing characters as well */
$tok = strtok($aString, " ");
while ($tok!== false) {
$len=strlen($tok);
$len=$len/2+1;
$tok=substr($tok,0,$len);
$b="tu";
$myresult=mysql_query("SELECT * FROM Customer2 WHERE MATCH (Topic,Des)
AGAINST ('$tok*' IN BOOLEAN MODE);");
while($row=mysql_fetch_array($myresult)){
echo "<br>";
echo "<br>";
echo " ";
$Cid=$row['Cid'];
echo " ";
$row['Count']=$row['Count']+1;
$Count=$row['Count'];
mysql_query("update Customer2 set Count='$Count' where Cid='$Cid'");
}
$tok = strtok(" ");
}
$result = mysql_query("select * from Customer2");
echo "<table border=0 width=50% [b]class='display'[/b] bgcolor='ccffff'>";
//[b]i will display result on the screen [/b]
while ($row=mysql_fetch_array($result)){
if($row['Count'] >0){
echo "<tr><td>";
echo $row['Des'];
echo "</td><td>";
echo $row['Count'];
echo "</td> </tr>";
}
}
$f=0;
mysql_query("update Customer2 set Count='$f'");
echo "</table>";
mysql_close($con);
?>
</body>
</html>