--- Robb Kerr <[EMAIL PROTECTED]> wrote:

> I'm trying to inform myself about exactly what
> Dreamweaver's PHP/MySQL code
> is doing when creating a recordset and repeat
> region. Please help if you
> can.
> 
> DW MX generates the following to create a simple
> recordset...
> Line 1) require_once('Connections/TBA.php');
> Line 2) mysql_select_db($database_TBA, $TBA);
> Line 3) $query_RS_CourseEnrollment = "SELECT * FROM
> tba_courseenrollment";
> Line 4) $RS_CourseEnrollment =
> mysql_query($query_RS_CourseEnrollment,
> $TBA) or die(mysql_error());
> Line 5) $row_RS_CourseEnrollment =
> mysql_fetch_assoc($RS_CourseEnrollment);
> Line 6) $totalRows_RS_CourseEnrollment =
> mysql_num_rows($RS_CourseEnrollment);
> 
> I understand (or think I understand) the
> following...
> Line 1 grabs the information from an external file
> to connect to the
> database.
> Line 2 creates the connection to the database using
> the data obtained in
> line 1.
> Line 3 creates the actual query and saves it to a
> variable.
> Line 4 executes the query and saves the result to a
> variable (I think).
> Line 5 grabs the currently "pointed to" record
> (usually the first) and
> assigns its contents to a PHP Array.
> Line 6 stores the number of records in the recordset
> to a variable.
> 
> In a repeat region DM MX writes...
> Line 1) <?php do { ?>
> Lines 2 - ?) put something on the page
> Line Last) <?php } while ($row_RS_CourseEnrollment =
> mysql_fetch_assoc($RS_CourseEnrollment)); ?>
> 
> I understand (or think I understand) the
> following...
> Line 1 starts the loop.
> Lines 2 through ? draws stuff on the page.
> Line Last restarts the loop by grabbing the next
> record in the recordset.
> 
> Here are my questions...
> 1) Do I understand what's going on?
> 2) When I ECHO the variable created in Line 4 of the
> connection I get
> "Resource id #4". Why don't I get "Array" or
> something I can read?
> 3) Because the last line of the repeat region
> includes
> "mysql_fetch_assoc($variableDefiningTheQuery)" does
> this mean that the
> database is queried every time through the loop?
> 4) I can't find "mysql_fetch_assoc()" in the MySQL
> documentation. What's
> this command do?
> 
> I know this is a long post and a lot of quesitons.
> Just trying to
> understand what's going on. And, maybe your answers
> will help others on the
> board.
> 
> Thanx,
> -- 
> Robb Kerr
> Digital IGUANA
> Helping Digital Artists Achieve their Dreams

I think some people on this list would consider that
more of a PHP question than MySQL. You might get
better responses on one of the Dreamweaver lists; I've
asked similar questions there.

Unfortunately, I can't answer your question, because I
never did figure this stuff out. I'm still relatively
new to PHP and MySQL, and I found it all very
confusing. I finally decided to ditch Dreamweaver's
PHP functions and hand code everything. I think that
was a good choice.

I still don't have a good perspective on everything,
but I THINK Dreamweaver's PHP functions are unfamiliar
to many PHP coders who don't use Dreamweaver. So if
you want to use the same language, it's better to
learn to speak plain PHP.

But I could be mistaken. Get some feedback from other
groups, and if I'm wrong, please let me know!



                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to