jeaker Posted November 9, 2006 Share Posted November 9, 2006 I have been working on this code for 3 days now and i am stumped. It is supposed to go to my server and get the stuff in the table "news" and output the news articles that are in the database. I cannot for the life of me figure out what the problem may be. Any help would be greatly appriciated.[code]<?php$db_name = "newdb";$table_name = "news";$connection = @mysql_connect("db.blah.com", "johndoe", "blah") or die(mysql_error());$db = @mysql_select_db($db_name, $conection) or die(mysql_error());$sql = "SELECT*FROM $table_name ORDER BY id";$result = @mysql_query($sql, $connection) or die(mysql_error());while ($row = mysql_fetch_array($result)) { $id = $row['id']; $title = $row['title']; $content = $row['content']; $timestamp = $row['timestamp'];$display_block = "$title, $content, $contact, $timestamp";}?><html><head><title>Megalomaniacs News</title></head><body><h1>Megalomaniacs Inc. Articles</h1><?php echo "$display_block"; ?><p><a href="main.html">Return to Menu</a></p></body></html>[/code] Link to comment https://forums.phpfreaks.com/topic/26728-help-getting-mysql-table-info-to-output-to-the-screen/ Share on other sites More sharing options...
blear Posted November 9, 2006 Share Posted November 9, 2006 "SELECT*FROM" needs some spaces. Try "SELECT * FROM" Link to comment https://forums.phpfreaks.com/topic/26728-help-getting-mysql-table-info-to-output-to-the-screen/#findComment-122258 Share on other sites More sharing options...
jeaker Posted November 9, 2006 Author Share Posted November 9, 2006 I tried that. Still nothing. The page is just coming up blank. Thank you though. Any more suggestions anybody? Link to comment https://forums.phpfreaks.com/topic/26728-help-getting-mysql-table-info-to-output-to-the-screen/#findComment-122263 Share on other sites More sharing options...
blear Posted November 9, 2006 Share Posted November 9, 2006 You might then try to take the error_msg suppressors out ( @ ) . That symbol tells the script to not output errors with that function to the screen. Link to comment https://forums.phpfreaks.com/topic/26728-help-getting-mysql-table-info-to-output-to-the-screen/#findComment-122274 Share on other sites More sharing options...
jeaker Posted November 9, 2006 Author Share Posted November 9, 2006 still nothing. ??? ??? ??? Link to comment https://forums.phpfreaks.com/topic/26728-help-getting-mysql-table-info-to-output-to-the-screen/#findComment-122294 Share on other sites More sharing options...
jeaker Posted November 10, 2006 Author Share Posted November 10, 2006 got it, thanks for the help man!!! ;D Link to comment https://forums.phpfreaks.com/topic/26728-help-getting-mysql-table-info-to-output-to-the-screen/#findComment-122546 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.