this was the code I posted that accidentally only went to Wolf: what does STFW mean? <?php include("inc/dbconn_open.php"); if (empty($_SESSION['AdminLogin']) OR $_SESSION['AdminLogin'] <> 'OK' ){ ?> <script language="javascript"> window.close(); </script> <?php exit(); } if (isset($_POST['AdminID'])){ $AdminID = $_POST['AdminID']; } elseif (isset($_GET['AdminID'])){ $AdminID = $_GET['AdminID']; } else { ?> <script language="javascript"> window.close(); </script> <?php exit(); } if (isset($_POST['WorkOrderID'])){ $WorkOrderID = $_POST['WorkOrderID']; } elseif (isset($_GET['WorkOrderID'])){ $WorkOrderID = $_GET['WorkOrderID']; } else { ?> <script language="javascript"> window.close(); </script> <?php exit(); } if (isset($_POST['ReturnPage'])){ $ReturnPage = $_POST['ReturnPage']; } elseif (isset($_GET['ReturnPage'])){ $ReturnPage = $_GET['ReturnPage']; } else { $ReturnPage = "Welcome.php"; } $sql = "SELECT WorkOrderID, CreatedDate, IONumber, OrderType, WorkOrderNumber, 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); $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); if (mysql_num_rows($result) == 0) { ?> <script language="javascript"> window.close(); </script> <?php exit(); } ?> On Mon, Nov 24, 2008 at 11:32 AM, Wolf <lonewolf@xxxxxxxxx> wrote: > > ---- Terion Miller <webdev.terion@xxxxxxxxx> wrote: > > Can anyone help explain what I need to do to fix this: > > > > Error: *Warning*: mysql_fetch_object(): supplied argument is not a valid > > MySQL result resource in * > > C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *57* > > > > *Warning*: mysql_num_rows(): supplied argument is not a valid MySQL > result > > resource in *C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on > line * > > 65 > > > > > > Code: > > line 57: $row = mysql_fetch_object ($result); > > line 65: if (mysql_num_rows($result) == 0) { > > ?> > > * > > STFW as Google has the answer.. > > But... you need to actually provide MORE of the code, since the error > pretty much tells you that you don't have a connection to your database. > Not a PHP issue really. > > Wolf >