Alright, here is a pretty simple one I do believe, just not quite simple enough for me to figure out 🙂
I am using a mySQL table to hold some information about some articles I'm using on my website. (article title, article url, article date, article author, etc...).
I want to use the id from the table to pull the variables I need out of the table so that my template will show them right; however, I don't understand how exactly to do that. I need the article url, and the article title.
Here is the code that I have so far. I'm just trying to echo the information back to the screen, so I can see if it is correct before I plug the script into my template.
<?
include("connect.inc");
$query1 = "SELECT url FROM news WHERE id=$id";
$page = "mysql_query($query1)";
$title = "mysql_query(\"SELECT title FROM news WHERE id=$id\")";
echo $page;
echo $title;
?>
Any ideas what I am doing wrong? Thanks for the help.