By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,747 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,747 IT Pros & Developers. It's quick & easy.

Displaying records

ddtpmyra
100+
P: 333
My php sql query display the correct number of rows I can tell because it displyas the row and columns but the cell or data are blank.

[PHP]
# Get the ID

$id = $_GET['id'];

// Connect to server and select databse.



$sql="SELECT * FROM $tbl_name where cmrid= {$id} ORDER BY id DESC" ;
$result=mysql_query($sql); echo"$sql $result";
?>[/PHP]

[PHP]//here's where I display my result
<?php
while($rows=mysql_fetch_array($result)){ // Start looping table row
?>
<td bgcolor="#FFFFFF"><? echo $rows['cmrid']; ?></td>
<td bgcolor="#FFFFFF"><a href="view_topic.php?id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a><BR></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['view']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['reply']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['datetime']; ?></td>

<?php
// Exit looping and close connection
}
mysql_close();
?>[/PHP]
Oct 27 '08 #1
Share this Question
Share on Google+
5 Replies


Markus
Expert 5K+
P: 6,050
Have you tried using the *correct* opening tags instead of just <? ... ?>
Oct 27 '08 #2

dlite922
Expert 100+
P: 1,584
Have you tried using the *correct* opening tags instead of just <? ... ?>
lol

Why do you get the easy ones? Are you on this site like 24/7?

:P




Dandeezy
Oct 28 '08 #3

Markus
Expert 5K+
P: 6,050
lol

Why do you get the easy ones? Are you on this site like 24/7?

:P




Dandeezy
Haha, I afraid I pretty much iz! A lot of spare time at the moment. I'll leave you a few from now on :P
Oct 28 '08 #4

ddtpmyra
100+
P: 333
I guess some of syntax varies on the platform used. Thanks for extending the information (help)

DM
Oct 28 '08 #5

Markus
Expert 5K+
P: 6,050
I guess some of syntax varies on the platform used. Thanks for extending the information (help)

DM
Indeed it does vary. You have to have short tags enabled in the PHP.INI file.

See you around.

Markus.
Oct 28 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.