MYSQL Advise

General FreeBASIC programming questions.
Post Reply
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

MYSQL Advise

Post by Gablea »

Hi Everyone,

I am sure i have seen what I am after on here before but I can not find it

What I need to do is the following

Once i have a result from the database I need to loop though the result to create a datastring


I have

Code: Select all

TotalCol = mysql_num_fields(MySQLOut)
   TotalRow = mysql_num_rows(MySQLOut)
    
	If debugmode = 1 Then print TotalRow
	
	
	Row = mysql_fetch_row(MySQLOut)
But I am not sure what to do now as I need to loop though the Results (4 results) to build a string like this

54,Ca,Dave's SuperMarkert Ltd
54,Ca,Hardingstone

so the feilds are lineaglinment(0) linefont (1) linetext (2)

Does anyone have any examples of how to loop though a MySQL Row result? I am sure I need to use a For Loop something like

For i =- 0 to TotalRow
RecipitHeadder += *row[0] & "," & *row[1] &"," & row[2]
next i
RockTheSchock
Posts: 252
Joined: Mar 12, 2006 16:25

Re: MYSQL Advise

Post by RockTheSchock »

You can directly export into CSV File:
https://www.mysqltutorial.org/mysql-exp ... le-to-csv/
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: MYSQL Advise

Post by Gablea »

I need to do this internally with in my program as I'm sending the result to a printer
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: MYSQL Advise

Post by badidea »

Post Reply