ryeman98 Posted May 13, 2007 Share Posted May 13, 2007 Wow...OK...here is my problem: On the main page of my site, I have an article that will display 3 sentences (I haven't figured out how to do that yet...) and at the bottom it has a link to article.php?article_id=#. My problem is that when I go there, it will say: Resource id #5 Here is my code for article.php <?php include("config.php"); if ((isset ($_GET['article_id']))) { $id = $_GET['article_id']; $query = "SELECT id FROM news WHERE id = $id"; $getarticle = mysql_query($query); echo $getarticle; } ?> Any help is good...thanks, Rye Quote Link to comment https://forums.phpfreaks.com/topic/51155-solved-get-methodmysql-helpurgent/ Share on other sites More sharing options...
ryeman98 Posted May 13, 2007 Author Share Posted May 13, 2007 I still haven't received help. Normally I am a very patient person but for some reason, tonight I just don't feel like it... :-\ Quote Link to comment https://forums.phpfreaks.com/topic/51155-solved-get-methodmysql-helpurgent/#findComment-251843 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 <?php include("config.php"); if ((isset ($_GET['article_id']))) { $id = $_GET['article_id']; $query = mysql_query("SELECT id FROM news WHERE id = $id"); $result = mysql_fetch_array($query); $getarticle = $result['id']; echo $getarticle; } ?> Should work Quote Link to comment https://forums.phpfreaks.com/topic/51155-solved-get-methodmysql-helpurgent/#findComment-251845 Share on other sites More sharing options...
ryeman98 Posted May 13, 2007 Author Share Posted May 13, 2007 That really helped but I've run into another problem, unfortunately. As stupid as I am, I didn't call up the articles title, date, or content...any ideas on how I could so I can display each thing separately like this: <?php Mysql stuff here... echo $title; echo $date; echo $content; ?> Quote Link to comment https://forums.phpfreaks.com/topic/51155-solved-get-methodmysql-helpurgent/#findComment-251849 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 <?php include("config.php"); if ((isset ($_GET['article_id']))) { $id = $_GET['article_id']; $query = mysql_query("SELECT * FROM news WHERE id = $id"); $result = mysql_fetch_array($query); $getarticle = $result['id']; $title = $result['title']; $date = $result['date']; $content = $result['content']; echo $getarticle; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/51155-solved-get-methodmysql-helpurgent/#findComment-251852 Share on other sites More sharing options...
ryeman98 Posted May 13, 2007 Author Share Posted May 13, 2007 Thanks so much man! I appreciate it! Quote Link to comment https://forums.phpfreaks.com/topic/51155-solved-get-methodmysql-helpurgent/#findComment-251853 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.