chico1st Posted August 19, 2006 Share Posted August 19, 2006 Okay i had a post yesterday but i figured out what the problem is therefore i have a new question, i had commands like $news_id = $row['[b]news.[/b]newsID']; whereas i needed $news_id = $row['newsID'];however this raises the issue that when i try to bring up the name of the news file i end up reading the name of the date.i want to say $name = $row[[b]'news.[/b]name']; but i have to say $name = $row['name']; which brings up the date's namehow can i force my code to accept $name = $row[[b]'news.[/b]name'];here is the code:$query = "SELECT news.newsID, news.pictureID, [b]news.name[/b], news.abstract, [b]date.name[/b] " . "FROM news, date WHERE news.dateID = date.dateID"; $result = mysql_query($query, $dbConn); //print 2 most recent news articles for( $i = 0; $i <2; $i++){ $output .= "\n<tr><td>"; $row = mysql_fetch_assoc($result); $news_id = $row['newsID'];i dont want to rename the elements of my table if it can be avoided $name = $row['name']; $abstract = $row['abstract']; $image_id = $row['pictureID']; Quote Link to comment Share on other sites More sharing options...
fenway Posted August 19, 2006 Share Posted August 19, 2006 You'll have to alias that column name. Quote Link to comment 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.