My code is skipping the first sql query and going to the second one wondering what I have wrong here.
$sql = "SELECT WorkOrderID, CreatedDate, IONumber, OrderType, Advertiser, AccountNum, Address, City, ";
$sql .= "State, Zip, Phone, Fax, ContactName, URL, AdvertisingAgency, ClickThru, Impressions, AdSize, ";
$sql .= "DATE_FORMAT(StartDate, '%m/%e/%Y') AS StartDates, DATE_FORMAT(EndDate, '%m/%e/%Y') AS EndDates, CPM, FlatRate, ";
$sql .= "IncludeSites, Package, Matrix, DATE_FORMAT(MatrixDate, '%m/%e/%Y') AS MatrixDates, Salesperson, SalespersonID, ";
$sql .= "SalespersonEmail, SalespersonExt, NameCampaign, SpecialInstructions, AdContactName, AdContactPhone, AdContactEmail, ";
$sql .= "Artwork, DATE_FORMAT(PrintDate, '%m/%e/%Y') AS PrintDates, ElectronicAd, EmailProof, ";
$sql .= "DATE_FORMAT(ProofDate, '%m/%e/%Y') AS ProofDates, ArtInstructions, Focus, BannerSize, BannerSizeOther, BannerType, ";
$sql .= "BannerTypeOther, ExtraImage1, ExtraImage1Desc, ExtraImage2, ExtraImage2Desc, ExtraImage3, ExtraImage3Desc, ";
$sql .= "ExtraImage4, ExtraImage4Desc, ExtraImage5, ExtraImage5Desc FROM workorderform WHERE WorkOrderID='$WorkOrderID'";
$result = mysql_query ($sql);
$row = mysql_fetch_object ($result);
/* added this to check for error */
$qr1 = mysql_query ($sql)
or die ("Query failed: " . mysql_error() . " Actual query: " . $query);
/* end of error check*/
$sql2 = "SELECT Date_FORMAT(CreatedDate,'%m/%e/%Y %h:%i %p') AS OrderDate, Location, WorkOrderName, Status FROM workorders ";
$sql2 .= "WHERE WorkOrderID='$WorkOrderID'";
$result2 = mysql_query ($sql2);
$row2 = mysql_fetch_object ($result2);
/* added error check*/
$qr2 = mysql_query ($sql2)
or die ("Query failed: " . mysql_error() . " Actual query: " . $query);
/* end of error check*/