Re: SQL syntax?
| From: | Allan Arguelles | Date: | Fri, 05 Dec 2008 22:14:35 +0000 |
| Subject: | Re: SQL syntax? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284206@lists.php.net to get a copy of this message | ||
Umm.. I meant you need to put
$sql .= "FROM workorderform ";
between these:
$sql .= "AdSize AS Ad_Size, CPM AS CPM_Rate, ";
$sql .= "ORDER BY StartDate DESC";
:)
Terion Miller wrote:
> On Fri, Dec 5, 2008 at 3:57 PM, Allan Arguelles <allan@arguelles.com.ph>wrote:
>
>
>>> $sql = "SELECT WorkOrderID AS Work_Order_ID, DATE_FORMAT(StartDate,
>>>
>> '%b.
>>
>>> %e, %Y %l:%i %p') AS Start_Date,
>>> DATE_FORMAT(EndDate, '%b. %e, %Y %l:%i %p') AS End_Date, ";
>>> $sql .= "Advertiser AS Advertiser_Name,AccountNum AS Account_Number,
>>> Impressions AS Ad_Impressions, ";
>>> $sql .= "AdSize AS Ad_Size, CPM AS CPM_Rate, ";
>>> $sql .= "ORDER BY StartDate DESC";
>>>
>>>
>> You forgot the tables, plus you have an extra comma after CPM_Rate.
>>
>> well I changed it to:
>>
>> $sql = "SELECT workorderform.WorkOrderID AS Work_Order_ID,
>> DATE_FORMAT(workorderform.StartDate, '%b. %e, %Y %l:%i %p') AS Start_Date,
>> DATE_FORMAT(workorderform.EndDate, '%b. %e, %Y %l:%i %p') AS End_Date,
>> ";
>> $sql .= "workorderform.Advertiser AS
>> Advertiser_Name,workorderform.AccountNum AS Account_Number,
>> workorderform.Impressions AS Ad_Impressions, ";
>> $sql .= "workorderform.AdSize AS Ad_Size, workorderform.CPM AS
>> CPM_Rate ";
>> $sql .= "ORDER BY StartDate DESC";
>>
>> and got the same error....
>>
>>
>>
>
>