I have a news page which pulls the news articles from mysql like this
"SELECT * FROM tbl_news WHERE pressid = $_GET['pressid'];"
This code pulls all the news for the particular pressid, now what I would like to do is some how have the tbl_news be dynamic, I have another table in mysql called tbl_articles, and depending on which link the user presses depends on the sql query,
i surpose i need an if statement,
if $_GET['pressid'] == 1 OR 2 OR 3 OR 4; {
"SELECT * FROM tbl_news WHERE pressid = $_GET['pressid'];"
} else {
"SELECT * FROM tbl_articles WHERE artid = $_GET['artid'];"
}
Will this work ? and is there any better soultions,
cheers