Author Topic: MySQL - Extract Column Data  (Read 2657 times)

0 Members and 1 Guest are viewing this topic.

Offline MLambert

  • Forum Regular
  • Posts: 115
    • View Profile
MySQL - Extract Column Data
« 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

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: MySQL - Extract Column Data
« Reply #1 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.

Offline MLambert

  • Forum Regular
  • Posts: 115
    • View Profile
Re: MySQL - Extract Column Data
« Reply #2 on: April 03, 2019, 07:01:28 pm »
Thank you
Mike