Jump to content

move my display result to the top


xbl1

Recommended Posts

Hello; :) 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 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>

Link to comment
Share on other sites

you have alot of '<br>'s in the page.

<br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br>
before the table in your results page.Have a look where they are generated from, and delete them :)also, your css on the results page
<style type="text/css"> table.display{margin-buttom:70%} </style>
you need to change it...firstly you spelt bottom wrong, you've missed the ';' off the end, and perhaps changing it to this:<style type="text/css">table.display{margin:auto;} </style>in your css in the code you posted above, you've missed then';' off the end afterthe percentangeyou have no opening <head> tags on either page. the meta tags and css should go inbeteen the <head> and </head> tags.:)
Link to comment
Share on other sites

you have alot of '<br>'s in the page.before the table in your results page.Have a look where they are generated from, and delete them :)also, your css on the results pageyou need to change it...firstly you spelt bottom wrong, you've missed the ';' off the end, and perhaps changing it to this:<style type="text/css">table.display{margin:auto;} </style>in your css in the code you posted above, you've missed then';' off the end afterthe percentangeyou have no opening <head> tags on either page. the meta tags and css should go inbeteen the <head> and </head> tags.:)
:) I have changeed like you say, it move to the cenetr of the page already. But i want to move it to top further more, i tried margin:1%, but it does not work. Do you have any idea for that?
<head>	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">		<style type="text/css">	table.display{margin:auto;}	</style></head>

Link to comment
Share on other sites

:) I have changeed like you say, it move to the cenetr of the page already. But i want to move it to top further more, i tried margin:1%, but it does not work. Do you have any idea for that?
<head>	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">		<style type="text/css">	table.display{margin:auto;}	</style></head>

:blink::blink: Thanks a lot, it works alrady. :):)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...