Jump to content

Code Help


pranshu82202

Recommended Posts

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]

Link to comment
https://forums.phpfreaks.com/topic/252993-code-help/
Share on other sites

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>';
}
}}
?>

Link to comment
https://forums.phpfreaks.com/topic/252993-code-help/#findComment-1297106
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.