Re: How MySQL Query and Fetch work?

From: Date: Wed, 09 Jan 2002 01:59:06 +0000
Subject: Re: How MySQL Query and Fetch work?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-79836@lists.php.net to get a copy of this message
Hi, Suppose you have a table students: student_id / student_name / GPA here is the code: $sql = "select * from students"; $result = mysql_query($sql); while(list($student_id, $student_name,$gpa)=mysql_fetch_array($result) { echo $student_name." has a GPA of".$gpa."<BR>"; } btw, this is something really basic, you should be able to go to the php.net and read the documentation. there are great examples. --- Alex Shi <chpshi@eol.ca> wrote: > Yesterday I posted a question yet got response. The > question > is regarding to how Query works. Now I repost it in a > more > specific way. > > I am just wondering how MySQL API functions work. Let's > look > at following two functions: > > 1. mysql_query(), > 2. mysql_fetch_array() > > To my understanding, mysql_query() will definately to its > job with > MySQL server. But how about the latter? Does it just > fetch data > from client/local buffer, which is previously put in by > mysql_query(), > or still has to goto server side to fetch data? > > Alex > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > For additional commands, e-mail: > php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > ===== Mehmet Erisen http://www.erisen.com __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/

« previous php.general (#79836) next »