Forum Moderators: coopster
But I have two problems in them. One is that no matter what command I use, print/printf/echo, the text appears on the top left of the page only. I cant get them to appear where I want them to on the page. And two, the actual content itself is not appearing. Instead something like Resource id#4, Resource id#5 appears for as many rows I have.
I am a PHP newbie..Please advise.
You need to put the PHP code at the right <td> to get it where you want it to appear.
Resource # comes, as far as I remember, when you try to print a row with out refering to the exact array like printing row[] instead of printing row[1].
If you post your code (the PHP ones), you might get more help.
Habtom
The other problem still persists. I have just given you that section of the code.
<?php
$result = mysql_query("SELECT count(*) FROM TableName");
for($i = 1; $i <= $result; $i++) {
$value = mysql_query("SELECT FieldName FROM TableName where IndexField = '$i'");
print($value);
?>  <?php
}
?>
I have three rows in my sample data and get Resource id#4, 5, 6 for this. I tried your idea by changing the above code to
$value = mysql_query("SELECT * FROM TableName where IndexField = '$i'");
print($value[1]);
This one simply returns no print value at all. It is just a few blanks for the   that I have given. Hope I got my problem clear here.
<?php
$i=1;while ($row = mysql_fetch_array(mysql_query("SELECT * FROM TableName where IndexField = '$i'"))) {
print($row[1]);
?>
  
<?php
$i++;
}
?>
Thanks all once again.