Jump to content

join rename


chico1st

Recommended Posts

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 name

how 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'];
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.