aznjay Posted November 22, 2006 Share Posted November 22, 2006 [code]$result6e = mysql_query("SELECT * FROM news ORDER BY id") or die(mysql_error()); while($row6e = mysql_fetch_array( $result6e )){echo "<a href=index.php?id=>". $row6e['id'] ."</a>";}if($_GET['news'] == '$row6e')?>[/code]Here's what I'm trying to do, I'm getting the info from column 'title' and showing it and I wanted to add "IF" coz' if i added that it'll get the html file from another table "pages". Link to comment https://forums.phpfreaks.com/topic/28037-linking-problema/ Share on other sites More sharing options...
aznjay Posted November 22, 2006 Author Share Posted November 22, 2006 [code]$result6e = mysql_query("SELECT * FROM news ORDER BY id DESC") or die(mysql_error()); while($row6e = mysql_fetch_array( $result6e )){$id = $row['id'];echo "<br><a href=nav1.php?id=". $row6e['id'] .">". $row6e['id'] ."</a>";if($id){$result89e = mysql_query("SELECT * FROM pages WHERE id='$id'") or die(mysql_error());$row89e = mysql_fetch_array( $result89e );echo "<b>". $row69['title'] ."</b>";}}?>[/code] Link to comment https://forums.phpfreaks.com/topic/28037-linking-problema/#findComment-128267 Share on other sites More sharing options...
jawapro Posted November 22, 2006 Share Posted November 22, 2006 Shouldnt $id = $row['id'];be $id = $row6e['id']? Link to comment https://forums.phpfreaks.com/topic/28037-linking-problema/#findComment-128269 Share on other sites More sharing options...
rotwyla98 Posted November 22, 2006 Share Posted November 22, 2006 and echo "<b>". $row69['title'] ."</b>";beecho "<b>". $row89e['title'] ."</b>";? Link to comment https://forums.phpfreaks.com/topic/28037-linking-problema/#findComment-128272 Share on other sites More sharing options...
aznjay Posted November 22, 2006 Author Share Posted November 22, 2006 [code]$result6e = mysql_query("SELECT * FROM news ORDER BY id DESC") or die(mysql_error()); while($row6e = mysql_fetch_array( $result6e )){$id = $row6e['id'];echo "<br><a href=nav1.php?id=". $row6e['id'] .">". $row6e['id'] ."</a>";if($_GET['id'] == '$id'){$result89e = mysql_query("SELECT * FROM pages WHERE id='$id'") or die(mysql_error());$row89e = mysql_fetch_array( $result89e );echo "<b>". $row89e['title'] ."</b>";}}?>[/code]It still doesn't work Link to comment https://forums.phpfreaks.com/topic/28037-linking-problema/#findComment-128284 Share on other sites More sharing options...
jawapro Posted November 22, 2006 Share Posted November 22, 2006 Which part dosnt work? What output do you get? Link to comment https://forums.phpfreaks.com/topic/28037-linking-problema/#findComment-128289 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.