blank blank

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
doggy
Forum Commoner
Posts: 80
Joined: Tue Dec 09, 2003 5:01 am
Location: South Africa

blank blank

Post by doggy »

i just get a blank result from this and there is stuff in my db and every thing works but this doesnt and i am clueless

Code: Select all

<?php
echo "<table width="150" border="0" cellpadding="0" cellspacing="0" bgcolor="#F2F2FF">"
    ."<tr>"
    ."<td width="150" height="19" valign="top" background="images/ban-1.gif"><div align="center"><b>Menu</b></div></td>"
    ."</tr><tr>"
    ."<td height="8"></td></tr><tr>"
    ."<td height="19" valign="top">";

$DB = new DB;                                                                                                                                    
                                                                                                                                                             
$DB->sql = "SELECT * FROM pages order by sOrder";                                                                                                  
$DB->result = mysql_query($DB->sql);                                                                                               
                                                                                                                                                             
while($DB->row = mysql_fetch_array($DB->result)) {                                                                      
  $id = $DB->row[id]; 
  $link = $DB->row[slink]; 

  echo "<a href="pages.php?id=$id">$link</a><br>";                                                                                                                                                             
  }               
  echo "</td>"
    ."</tr></table><br>";

?>
[/google]
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Maby you should add some

Code: Select all

.mysql_error());
lines into them to see if something might go wrong with the connecting!
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Are you connecting to the database?

:: [php_man]mysql_connect[/php_man]
:: [php_man]mysql_select_db[/php_man]
User avatar
phpcoder
Forum Contributor
Posts: 158
Joined: Sat Nov 02, 2002 1:18 pm
Location: Manchester, UK

Post by phpcoder »

Code: Select all

<?php
$id = $DB->row['id']; 
  $link = $DB->row['slink']; 

  
?>
Post Reply