You are here: pleeeez!! so easy but??! « PHP SQL « IT news, forums, messages
pleeeez!! so easy but??!

Posted by Beshoo on 02/12/06 01:01

hi
I have this function to print each question and it`s answar / actually
from 2 tables answers and questions /

I am taking the "question id" to be the "answer parent_id",so that I
can know each question and its answers..... ok!!

the quey like this:

function display (){
$sql="SELECT * from answers,questions WHERE
answers.parent_id=questions.question_id";
$exe=mysql_query($sql);
while ($row=mysql_fetch_assoc($exe))
{
echo $row['answer']."<br>";
echo $row['quest']."<br>";

}
}
display();

the problem is.. in this way the question will be printed more than one
time , in another word the questios will be printed each time its
answer printed !!!

SO how I can print the question just one time???!!!
pleeeez !!!
thank you very much my frnds !!!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация