Jump to content

jakebur01

Members
  • Posts

    885
  • Joined

  • Last visited

Everything posted by jakebur01

  1. Any query you try to do with it is slow as all get out. I was using navicat to import the item data over to MySQL and it has been loosing its connection during the middle of the transfer. There are a little over 100,000 items. I know it can't be navicat, because I have imported from other ODBC connection types with about 300,000 rows and 20 or more columns. I'm think about building some kind of custom update/transfer script with php. Jake
  2. I do not have the option that I know of to do a LIMIT 10 in my odbc query. How can I get it to count the number of while loops and stop at 10? while (odbc_fetch_row($rs)) { }
  3. I think in this odbc query the select where the purchase date is greater that the scan date is not working. Here is an example of one row: Scan date=03/21/11 Purchase date=09/07/06. SELECT PURDATE1, RECNO5 FROM ARVEND WHERE PURDATE1 > '03/21/11' AND ITEM = '0270' AND PURDATE1 <> '' Query: SELECT PURDATE1, RECNO5 FROM ARVEND WHERE PURDATE1 > '$checklastdate' AND ITEM = '$ITEM' AND PURDATE1 <> ''
  4. Basically, this part of the code is checking the "scanned" table in my mysql database to get the last scanned date for the item at hand. It then takes that date and selects all the vendor items in the odbc table "ARVEND" that are greater than the last purchase date. || This is where I am running into a problem. When it loops through each vendor item it selects from the "associated" mysql table to see if the vendor item has been scanned. If it does not find anything I am trying to get the $checkpurdate variable to add 1 to itself. | In the second script you will see the elseif($checkpurdate>0) .... Here I am saying if there are any vendor items that have not been scanned, highlight the row in yellow. But, this part of my code $checkpurdate = $checkpurdate + 1; does not seem to be counting correctly. Sometimes it counts '4' for an item when there are only two vendor items available. All of this may sound confusing since you may not know what I am trying to do. But, the main problem I am having is the counting part is returning wrong numbers. $checkpurdate = $checkpurdate + 1; /* $checkpurdate */ $query3 = "SELECT date FROM scanned WHERE `item` = '$ITEM' ORDER BY date DESC LIMIT 1"; $result3 = mysql_query($query3); $checklastdate = ""; while($row3 = mysql_fetch_array($result3, MYSQL_ASSOC)) {$checklastdate= $row3['date']; $checklastdate=date("m/d/y", strtotime($checklastdate)); } //checkpurdate loops $checkassoc="0"; $checkpurdate="0"; $sqlc="SELECT RECNO5 FROM ARVEND WHERE PURDATE1 > '$checklastdate' AND ITEM = '$ITEM'"; $rsc=odbc_exec($conn,$sqlc); if (!$rsc) {exit("Error in SQL");} while (odbc_fetch_row($rsc)) { $checkrecno5=odbc_result($rsc,"RECNO5"); $checkassosquery = "associated WHERE `VENDORID` = '$checkrecno5' AND ITEM = '$ITEM'"; $checkassoc = get_rows($checkassosquery); if($checkassoc>0) { // do nothing } else { $checkpurdate = $checkpurdate + 1; } } elseif($checkpurdate>0) { echo"<TR class=\"NV\"> <TD>"; }
  5. Don't have that option right now. Just trying to do the best with what I have to work with. I need to figure out a way to generate a preview of the 1st page of pdf document.
  6. Is there any way to generate a small image of the 1st page of a pdf document without using a 3rd party like imagemagic. The site is hosted a register.com so I am thinking I am going to be limited to the basic php functions.
  7. What is the correct way to use the backslash here? I am using an ftp script and retrieving the brand directory name through url. I want to catch it if they try to use \ in the url to list all directories. elseif($_GET[f]=="\") { echo "You have entered an invalid vendor."; $_SESSION['brand_path'] = "INVALID"; }
  8. cmd output: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\bruser>php C:\Inetpub\wwwroot\test.php <html> <body> <table><tr><th>UPC</th><th>ITEM</th></tr><tr><td></td><td></td></tr><tr><td>7895 9-02120</td><td>6105</td></tr><tr><td>2959900038</td><td>8623</td></tr><tr><td>0 72564053048</td><td>0553</td></tr><tr><td>03874402233</td><td>0898</td></tr><tr> <td>03874402277</td><td>0899</td></tr><tr><td>85771-24508-9</td><td>6940</td></t r><tr><td>10099709600120</td><td>8972</td></tr><tr><td>052100010762</td><td>8252 </td></tr><tr><td>41799853811</td><td>0634</td></tr><tr><td>72714100113</td><td> 0992</td></tr><tr><td>9357388262</td><td>1000</td></tr><tr><td>9357388263</td><t d>1002</td></tr><tr><td>9357388264</td><td>1004</td></tr><tr><td>9357388265</td> <td>1006</td></tr><tr><td>9357388794</td><td>1008</td></tr><tr><td>9357388266</t d><td>1010</td></tr><tr><td>9357728040</td><td>1428</td></tr><tr><td>9047821211< /td><td>1552</td></tr><tr><td>9047821241</td><td>1553</td></tr><tr><td>904782121 2</td><td>1554</td></tr><tr><td>9047821240</td><td>1556</td></tr><tr><td>9047821 214</td><td>1558</td></tr><tr><td>9047821243</td><td>1560</td></tr><tr><td>90478 21213</td><td>1562</td></tr><tr><td>9047821218</td><td>1563</td></tr><tr><td>904 7821621</td><td>1564</td></tr><tr><td>9047821622</td><td>1566</td></tr><tr><td>9 047821628</td><td>1568</td></tr><tr><td>9047821630</td><td>1570</td></tr><tr><td >9047821623</td><td>1572</td></tr><tr><td>8615415131</td><td>1574</td></tr><tr>< td>4230100006</td><td>1576</td></tr><tr><td>8615475139</td><td>1578</td></tr><tr ><td>2986000101</td><td>1580</td></tr><tr><td>9047821220</td><td>1582</td></tr>< tr><td>5100001296</td><td>1606</td></tr><tr><td>93573882639</td><td>1002</td></t r><tr><td>30908382380</td><td>0776</td></tr><tr><td>21952006229</td><td>0398</td ></tr><tr><td>93573882622</td><td>1000</td></tr><tr><td>51353001025</td><td>0089 </td></tr></table> </body> </html> C:\Documents and Settings\bruser>^A^A safari/ie output: <html> <body> <br /> <b>Warning</b>: odbc_connect() [<a href='function.odbc-connect'>function.odbc-connect</a>]: SQL error: [simba][simbaEngine ODBC Driver][DRM File Library]No such database., SQL state 08004 in SQLConnect in <b>C:\Inetpub\wwwroot\test.php</b> on line <b>6</b><br /> Connection Failed:
  9. Does anybody have any idea why I can access the data from this odbc connection through the command prompt but not through my web browser?
  10. also using fastcgi
  11. If you are updating existing data, you probably could just add a column to the database and call it ticket_id and update the ticket id into that column. Just have php generate the unique number, have php check to be sure this number is not already being used, if so create another id, check again, then update the number into the column. If you could post your html form code and the php you are using to update or post, I might could help you better.
  12. Oh... and I'm running php 5.3.6 with IIS 5 on xp professional.
  13. It is some kind of permission issue. If I run: php C:\Inetpub\wwwroot\test.php from the command line, it prints out all the table data. What permissions do I need to set in order to be able to access this data through my browser?
  14. I have "UPC" setup as a system dsn, type "CodeBaseOdbcStand", and I can connect to it from access. However, I am not having success yet using php. This is a connection to .dbf /.cdx files for data associated with our inventory program. ERROR PHP Warning: odbc_connect() [<a href='function.odbc-connect'>function.odbc-connect</a>]: SQL error: [simba][simbaEngine ODBC Driver][DRM File Library]No such database., SQL state 08004 in SQLConnect in C:\Inetpub\wwwroot\test.php on line 6 CODE <html> <body> <?php $conn=odbc_connect('UPC','',''); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT * FROM ARUPC"; $rs=odbc_exec($conn,$sql); if (!$rs) {exit("Error in SQL");} echo "<table><tr>"; echo "<th>UPC</th>"; echo "<th>ITEM</th></tr>"; while (odbc_fetch_row($rs)) { $UPC=odbc_result($rs,"UPC"); $ITEM=odbc_result($rs,"ITEM"); echo "<tr><td>$UPC</td>"; echo "<td>$ITEM</td></tr>"; } odbc_close($conn); echo "</table>"; ?> </body> </html>
  15. I have two tables with the same columns. ARINVOI and ARYINVO. ARINVOI stops at 2011-02-26 and ARYINVO starts at 2011-02-27. The ARYINVO is basically a history table. The ARINVOI only keeps data for so long before transferring it into ARYINVO. I am wanting to attach the tables together as if they were one and query sales data. Here is a query for one of the tables: SELECT ITOTAL FROM ARYINVO WHERE `INVDTE` >= '$YTDB' and `INVDTE` <= '$YTDE' AND `CUSTNO` <> '01885' AND `REFNO` <> 'CR. MEMO'
  16. I think I may have it. I am changing all of my echo's to $message =.
  17. I am generating a few different reports through mysql querys and displaying tables. I have a mail script that stores html code into a variable called $message. How can I store all of my queried data into the variable $message? Example of one of the three tables I am displaying and I am wanting to store this whole table into the variable $message. echo"<h3>Margin Less than 15% for $datequery</h3>"; echo"<table border=1 cellpadding=3><tr><td><center><b>Invoice Number</b></center></td><td><center><b>Invoice Date</b></center></td><td><center><b>Customer Number</b></center></td><td><center><b>Company</b></center></td><td><center><b>Margin</b></center></td></tr>"; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $invoice=$row['INVNO']; $invoicedate=$row['INVDTE']; $customernumber=$row['CUSTNO']; $company=$row['COMPANY']; $invoicetotal=$row['ITOTAL']; $invoicecost=$row['ICOST']; @$ABOVE30= @($invoicecost * 100) / $invoicetotal; @$FINAL30=100 - $ABOVE30; $FINAL30=number_format($FINAL30, 2, '.', ''); IF($FINAL30<="15") { echo "<tr><td><center>$invoice</center></td><td><center>$invoicedate</center></td><td><center>$customernumber</center></td><td><center>$company</center></td><td><center>$FINAL30%</center></td></tr>"; } } echo"</table><hr />";
  18. How can I query for orders above 30% margin, orders below 15% margin, and orders below cost WHERE invoice date = tomorrow. Here are the fields I am working with: INVNO //invoice number IVDTE // invoice date CUSTNO //customer number COMPANY // company ITOTAL //invoice total ICOST //invoice cost I can query for orders below cost, but I am not advanced enough to query margins. - Jake.
  19. I basically have a page for updating information with 4 or 5 different tabs to navigate between. When the info is saved, I submit/post to the same page and I have an if $_POST statement at the top of the page that catches it. I am then trying to redirect to the the same page and same anchor.
  20. Still searching on how to store a javascript value into a php variable. I haven't figured it out yet. <?PHP $hash="<script type=text/javascript> document.write(location.hash); </script>"; ?> <input type="hidden" name="hash" id="textfield" value="<?php echo"$hash";?>"/>
  21. cool. that will work great. I'll pass it through in a hidden form field then attach it to the end of the http_referer . Thanks Ken.
  22. How can I get http_referer to retrieve the anchor in the url? It keeps url variables, but it does not get the anchor. Example: http://example.com/ex.php?id=10#tab=3 All http_referrer catches is http://example.com/ex.php?id=10 code: $refer = $_SERVER['HTTP_REFERER']; <script type="text/javascript"> <!-- window.location = "<?PHP echo"$refer";?>" //--> </script>
  23. It was the quotations. Thanks.
  24. Failed with error: Unknown column 'AD ALLOWANCE' in 'where clause'
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.