quickstopman Posted July 8, 2007 Share Posted July 8, 2007 hey guys im a homemade forum and in my page where you can view the post it shows the users knickname i made it so when you post a topic it put the users id in the posted_by section and when your on the page it mysql_query selects the user knickname but in stead of that it just say request id #5 here is the code: <? ob_start(); session_start(); include("header.php"); include("config.php"); if (isset($_GET['postID']) && is_numeric($_GET['postID'])) { $sql = mysql_query("SELECT * FROM post WHERE id='". $_GET['postID'] ."'"); $info['post'] = mysql_fetch_array($sql) or die(mysql_error()); $postername = mysql_query("SELECT knickname FROM users WHERE id = '{$info['post']['posted_by']}' "); if (empty($info['post'])) { echo "The post your are looking for has either been deleted or doesn't exist yet"; } else { echo $info['post']['topic']; echo " Posted By: ". $postername ."<br><br>"; echo $info['post']['content']; } } else { header("Location:posts.php"); } ?> Link to comment https://forums.phpfreaks.com/topic/58892-odd-mysql_query-select/ Share on other sites More sharing options...
AndyB Posted July 8, 2007 Share Posted July 8, 2007 execute query retrieve array that's how you handled the first query to get the info[] values. You need to handle $postername the same way. Link to comment https://forums.phpfreaks.com/topic/58892-odd-mysql_query-select/#findComment-292215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.