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

pranshu.a.11@gmail.com

Link to comment
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.