I have recently learn PHP and i am trying to write a function which can return a row from selected query. For example i have a table named as Boards and it consist of following rows as Advertisers, Location, Clicks, Hits, DateStart, DateEnd and i am trying to use the following function
PHP Code:
$advertiser1 = 'ACM';
function submit($advertiser1)
{
$q = "SELECT Advertiser1, location, Clicks, Hits, datestart, dateend FROM
Boards where Advertisers like '$advertiser1'";
if($r=odbc_exec($sqlconnect, $q))
while($row=odbc_fetch_row($r))
{
$Advertiser = odbc_result($r,"Advertisers");
$location = odbc_result($r,"location");
$Clicks = odbc_result($r,"Clicks");
$Hits= odbc_result($r,"Hits");
$start = odbc_result($r,"datestart");
$end = odbc_result($r,"dateend");
}
}
With the following code i will be getting two rows. Now can anyone tell me which function i have write so that i will return 2 Rows identical to the Advertiser name. In short i need a function which returns me all the data for the specific advertiser name.
Bookmarks