From: Date: July 13 1999 10:12pm Subject: MYSQL error? (fwd) List-Archive: http://lists.mysql.com/mysql/7193 Message-Id: <14219.40378.536660.980264@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Claudia M. Castaneda writes: > ---------- Forwarded message ---------- > Date: Tue, 13 Jul 1999 09:59:49 -0400 > From: Gyorgy Fekete > To: bane@stripped, claudia@stripped > Subject: MYSQL error? > > > In case anyone cares... > > In mysql documentation (Node: mysql_fetch_field_direct) > the example given: > > MYSQL_FIELD *field; > field = mysql_fetch_field_direct(result, i); > > is wrong. It should be: > > field = &mysql_fetch_field_direct(res, ui); > --------------^---------------- > The docs give the prototype > MYSQL_FIELD *mysql_fetch_field_direct(MYSQL_RES *result, unsigned int fieldnr) > which *SEEMS* correct, but the mysql.h file revelas that this function is > really a macro, therefore the type checking is weak. Discovery of this error > came from the compiler message: > > mt.c: In function `main': > mt.c:53: incompatible types in assignment > make: *** [mt.o] Error 1 > > for the line > > field = mysql_fetch_field_direct(res, ui); // res, ui are as approrpiate > > I changed it to: > > field = &mysql_fetch_field_direct(res, ui); > > and everything was fine. > > > --------------------------------------------------------------------- > Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before > posting. To request this thread, e-mail mysql-thread7170@stripped > > To unsubscribe, send a message to the address shown in the > List-Unsubscribe header of this message. If you cannot see it, > e-mail mysql-unsubscribe@stripped instead. > > Thanks ! Sinisa +----------------------------------------------------------------------+ | TcX ____ __ _____ _____ ___ == mysql@stripped | | /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic | | /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped| | /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus | | /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ | | ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ | | /*/ \*\ Developers Team | +----------------------------------------------------------------------+