-
Problem calling data from mySQL
I have been re-working a website, and moving everything to a database.
I have the menu up, I can even list the articles available for reading. I have one problem left.
To make things 'easier', I decided to just do a target="_blank" to read each article in their own window. The problem is, when the window opens the query.php file, I get a empty table.
are outside the while loop construct. the tr's and td's are inside...
The article_name, the article_id, and the article_text do not show up. even tho when I run the raw query in mysql I get my desired results.
The only thing I can think of, is its not taking the article_id=1 in the url and passing it into the mysql statement. Any advise how I can do this?
My existing code is as follows
[code query.php]
<?php
include "required/db.inc.php";
$result = mysql_query("SELECT * FROM EFN_articles WHERE id = '$article_id'",$db);
echo "<table border=1>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td align=center>%s</td></tr>
<tr><td align=left>%s</td></tr>\n",
$myrow[3], $myrow[5]);
}
echo "</table>\n";
?>
[/code]
Many thanks,
Thomas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|