Fetch result from query - mydac - delphi
Posted: Tue 28 Oct 2008 01:57
hi.. i have this code
i got
myconnection
myquery
mydatasource
and dbgrid
when i execute this.. result will display on my dbgrid.
what i want to is to display it on a caption or on the dbtext
or anaywhere else but not on the dbgrid
im sorry im not really expert into this..
example in php
if this is in php .. how will i do it in delphi using mydac ..
i just want to fetch the data from my query and display it. like puting it into label caption..
thanks in advance
br[/code][/quote]
i got
myconnection
myquery
mydatasource
and dbgrid
Code: Select all
try
myQuery1.SQL.Text := 'SELECT MIN(ticketnum) FROM onque WHERE status="waiting" ';
myQuery1.Execute ;
finally
// myQuery.Close ;
end;what i want to is to display it on a caption or on the dbtext
or anaywhere else but not on the dbgrid
im sorry im not really expert into this..
example in php
Code: Select all
$query = " select * from table where id='2' ";
$result = mysql_query($result) or die ('error ');
if ($result) {
$row = mysql_fetch_assoc($result);
$name = $row['name'];
$id = $row['id'];
echo "id: $id name: $name";
}i just want to fetch the data from my query and display it. like puting it into label caption..
thanks in advance
br[/code][/quote]