Recent

Author Topic: SQL - Query  (Read 4400 times)

nico88desmo

  • New member
  • *
  • Posts: 9
SQL - Query
« on: April 17, 2007, 06:42:13 pm »
Hello!

I need to catch a field of a table;

after to have made this:
SQLQuery1.SQL.Add('SELECT email FROM connessi');

i need 'email' field;
how can I catch it?

In Borland Delphi i wrote:
- edit1.text := sqlquery1['email']:
and it worked...

Thank to All!

RudieD

  • Full Member
  • ***
  • Posts: 234
RE: SQL - Query
« Reply #1 on: April 17, 2007, 07:13:00 pm »
Don't you mean SQLQuery1.Fields[1].AsString or SQLQuery1.FieldByName('email').AsString ?
The FRED Trainer. (Training FRED with Lazarus/FPC)

RudieD

  • Full Member
  • ***
  • Posts: 234
RE: SQL - Query
« Reply #2 on: April 17, 2007, 07:16:11 pm »
Sorry, I mean

Code: [Select]
SQLQuery1.Fields[0].AsString or
Code: [Select]
SQLQuery1.FieldByName('email').AsString ?
The FRED Trainer. (Training FRED with Lazarus/FPC)

nico88desmo

  • New member
  • *
  • Posts: 9
Re: RE: SQL - Query
« Reply #3 on: April 19, 2007, 07:45:55 pm »
Quote from: "RudieD"
Sorry, I mean

Code: [Select]
SQLQuery1.Fields[0].AsString or
Code: [Select]
SQLQuery1.FieldByName('email').AsString ?


i've done and it functions! Great!  :D

MayaMcCarthy

  • Newbie
  • Posts: 1
Re: SQL - Query
« Reply #4 on: November 02, 2020, 10:51:18 am »
You need to get the full content of the table. That will allow you to find the emails columns heading. Now you can use that field in your SQL Query to get the emails.
Example.
First Query "Select * From Users"
Now you will get all the information of users. Here check for the email column and obtain the header of that column.
Second Query "Select * From Users Where User_Email abc@gmail.com"
That's all!

 

TinyPortal © 2005-2018