QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: MLambert on March 31, 2019, 09:49:15 pm

Title: MySQL - Extract Column Data
Post by: MLambert on March 31, 2019, 09:49:15 pm
Hi,

Using the select statement "Select PostCode from Database .....

In QB64 can I use the name PostCode to obtain the post code information or do I have to use DB_RESULT(columns, rows) to obtain the post code information ?

Currently no value is being passed back to the program if I just reference the SQL column name.

I am using the Wiki MySQL code.

By the way the wiki example code is missing the "dim share rows" and "dim share columns"  reference to rows and columns . Without this the return values is always 0 for both fields from the function call DB_QUERY.

Mike
Title: Re: MySQL - Extract Column Data
Post by: Juanjogomez on April 03, 2019, 01:44:44 pm
Hi,
If you use "SELECT PostCode FROM Database...." the result will be the rows you have, and a single column, because you are only selecting that data.
The result will always be saved in DB_RESULT (1, n) where 'n' are the rows that match the WHERE you entered in the query.
Title: Re: MySQL - Extract Column Data
Post by: MLambert on April 03, 2019, 07:01:28 pm
Thank you
Mike