/view_article.php?id= blank

[php]
// Query the database.
$query = “SELECT article_title, article_intro, article_full, article_subject, main_id FROM main AS u, article_info AS ut WHERE ut.article_id = u.article_id AND u.user_id=$t AND u.approved = ‘Y’ ORDER BY date_submitted desc”;
$result = mysql_query ($query)
or die(mysql_error());

while($row = mysql_fetch_array($result))

{
$article_title=$row[‘article_title’];
$article_intro=$row[‘article_intro’];
$id=$row[‘article_id’];

// Print out the contents of the entry
echo ’ ’ .’ ‘.$article_title.’’ ."
";

echo “
”.$row[‘article_intro’].’… read more’."

";
}
[/php]

I need to have article_id as id, but it doesn’t know.

What I can do is have main_id as id and it takes me to main_id page, which is blank. (http://writeaway.igraphic.co.uk/view_article.php?id=42)

Please advice

ADMIN EDIT: Changed the CODE tags to PHP tags for Syntax Highlighting

First of all, get your quotes worked out. I see a few occasions where single quotes and double quotes are mixed up. Also, where are you retrieving article_id from your database? I don’t see it in the query.

Actually after turning on the “Syntax Highlighting” the quotes are ok. Not consistent but they are ok. It’s that consistency (or lack thereof) that makes it confusing, however.

Darn, you’re right :stuck_out_tongue: Missed that because of the inconsistency.

Sponsor our Newsletter | Privacy Policy | Terms of Service