Dear
I want to write a function that can return a row or a set of rows from a select query
for example I have the table Banners containning the following Rows:
Advertiser | Location | Clicks | Hits | Date_Start | Date_End
ACM Left 10 5 01/01/2008 31/07/2008
ACM middle 10 5 01/08/2009 31/08/2009
And the function
$advertiser = 'ACM';
function submit($advertiser)
{
$q = "SELECT Advertiser, location, Clicks, Hits, date_start, date_end FROM
Banners where Advertiser like '$advertiser'";
if($r=odbc_exec($sqlconnect, $q))
while($row=odbc_fetch_row($r))
{
$Advertiser = odbc_result($r,"Advertiser");
$location = odbc_result($r,"location");
$Clicks = odbc_result($r,"Clicks");
$Hits= odbc_result($r,"Hits");
$start = odbc_result($r,"date_start");
$end = odbc_result($r,"date_end");
}
}
So this Query should return 2 Rows.
How to write this function in order to return the 2 Rows identical to the Advertiser name,
I want a function that returns for me all the data for the specific advertiser name
any Help please????
thanks a lot