pranshu82202 Posted December 12, 2011 Share Posted December 12, 2011 I am printing something on my page by php but i m not getting why code doesnt print from the top of the page.... It starts printing by leaving arount 300px from top........ I also applied css but it also does not solve that...... Here is my code : <?php include('dbcon.php'); $arr[0]="ankur";$arr[1]="archie";$arr[2]="deepesh";$arr[3]="jyoti";$arr[4]="pranshu";$arr[5]="nikunj"; $arr[6]="Vikas"; $sqlq = mysql_query("select * from money "); while($row = mysql_fetch_array($sqlq)) { if($row['name1']==$arr[0]) $no1=0; if($row['name1']==$arr[1]) $no1=1; if($row['name1']==$arr[2]) $no1=2; if($row['name1']==$arr[3]) $no1=3; if($row['name1']==$arr[4]) $no1=4; if($row['name1']==$arr[5]) $no1=5; if($row['name1']==$arr[6]) $no1=6; if($row['name2']==$arr[0]) $no2=0; if($row['name2']==$arr[1]) $no2=1; if($row['name2']==$arr[2]) $no2=2; if($row['name2']==$arr[3]) $no2=3; if($row['name2']==$arr[4]) $no2=4; if($row['name2']==$arr[5]) $no2=5; if($row['name2']==$arr[6]) $no2=6; $arrm[$no1][$no2]=$arrm[$no1][$no2]+$row['amm']; } echo "<table border='1' id=hor-minimalist-a style=width:750px> <tr> <th>Jisne Diye</th> <th>Kisko diye</th> <th>Kitne Diye </th> <th>Details </th> </tr>"; for($i=0; $i<7; $i++) {for($j=0; $j<7; $j++) { if($arrm[$i][$j]!=0 && $arr[$i]!=$arr[$j]) { echo "<tr>"; echo "<td>" . $arr[$i] . "</td>"; echo "<td>" . $arr[$j] . "</td>"; echo "<td>" . $arrm[$i][$j] . "</td>"; echo "<td><a href=viewdet.php?user1=" . $arr[$i]. "&user2=".$arr[$j].">View Details </a></td>"; echo "</tr>"; echo '<br>'; } }} ?> Any help would be appreciated.... -PRANSHU AGRAWAL [email protected] Quote Link to comment https://forums.phpfreaks.com/topic/252993-code-help/ Share on other sites More sharing options...
pranshu82202 Posted December 12, 2011 Author Share Posted December 12, 2011 Any one here for help........ ...... ADMINS AND MODERATORS ............ Quote Link to comment https://forums.phpfreaks.com/topic/252993-code-help/#findComment-1297094 Share on other sites More sharing options...
kney Posted December 12, 2011 Share Posted December 12, 2011 Post your css code Quote Link to comment https://forums.phpfreaks.com/topic/252993-code-help/#findComment-1297095 Share on other sites More sharing options...
Pikachu2000 Posted December 12, 2011 Share Posted December 12, 2011 Don't whine about not getting free help. Quote Link to comment https://forums.phpfreaks.com/topic/252993-code-help/#findComment-1297101 Share on other sites More sharing options...
btellez Posted December 12, 2011 Share Posted December 12, 2011 Does "dbcon.php" print anything? Are you at the very least getting the output you are expecting from PHP? also, you should probably ensure your enclosing your html attribute values in proper quotes to eliminate unexpected parsing of html attributes in your web browser... /* escaped double quotes inside your php double quotes*/ echo "<table border='1' id=\"hor-minimalist-a\" style=\"width:750px\"> <tr> <th>Jisne Diye</th> <th>Kisko diye</th> <th>Kitne Diye </th> <th>Details </th> </tr>"; for($i=0; $i<7; $i++) {for($j=0; $j<7; $j++) { if($arrm[$i][$j]!=0 && $arr[$i]!=$arr[$j]) { echo "<tr>"; echo "<td>" . $arr[$i] . "</td>"; echo "<td>" . $arr[$j] . "</td>"; echo "<td>" . $arrm[$i][$j] . "</td>"; echo "<td><a href=\"viewdet.php?user1=" . $arr[$i]. "&user2=".$arr[$j]."\">View Details </a></td>"; echo "</tr>"; echo '<br>'; } }} ?> Quote Link to comment https://forums.phpfreaks.com/topic/252993-code-help/#findComment-1297106 Share on other sites More sharing options...
pranshu82202 Posted December 12, 2011 Author Share Posted December 12, 2011 yes btellez i m getting the correct output but the o/p is shifted downwards....... And dbcon,.php just containt database connectivity query......... Quote Link to comment https://forums.phpfreaks.com/topic/252993-code-help/#findComment-1297107 Share on other sites More sharing options...
PFMaBiSmAd Posted December 12, 2011 Share Posted December 12, 2011 It would help if you did a 'view source' of the page in your browser and posted the result. Quote Link to comment https://forums.phpfreaks.com/topic/252993-code-help/#findComment-1297111 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.