Posted By

Mainer82 on 08/03/12


Tagged

php


Versions (?)

PHP problem 1


 / Published in: PHP
 

URL: None

Comments

  1. <?php
  2. // Request the text electronic items
  3. $result = @mysql_query("SELECT oc_oientry,oc_ieentry,oc_sysitem,oc_item,oc_itemdesc,oc_manpub,oc_model,oc_serial,oc_purchasedate,oc_pubmandate,oc_amount,oc_price,oc_retailer,oc_upload1,oc_upload2,oc_upload3 FROM ogden_catalog WHERE oc_sysitem LIKE ('ElectronicItem') ORDER BY oc_item ASC");
  4.  
  5. if (!$result) {
  6. exit('<p>Error performing query: ' . mysql_error() . '</p>');
  7. }
  8. //creating the table w/ headers
  9. echo '
  10. <table>
  11. <thead>
  12. <tr>
  13. <th style="width:250px"><strong><a href="other-items.php?order=oc_item">Name</a></strong></th>
  14. <th style="width:250px"><strong><a href="other-items.php?order=oc_itemdesc">Description</a></strong></th>
  15. <th style="width:150px"><strong><a href="other-items.php?order=oc_manpub">Manufacturer</a></strong></th>
  16. <th style="width:250px"><strong><a href="other-items.php?order=oc_model">Model</a></strong></th>
  17. <th style="width:120px"><strong><a href="other-items.php?order=oc_serial">Serial</a></strong></th>
  18. <th style="width:60px"><strong><a href="other-items.php?order=oc_amount">Amount</a></strong></th>
  19. <th style="width:84px"><strong><a href="other-items.php?order=oc_price">Price</a></strong></th>
  20. <th style="width:110px"><strong><a href="other-items.php?order=oc_purchasedate">Purchased</a></strong></th>
  21. <th style="width:90px"><strong><a href="other-items.php?order=oc_pubmandate">Manufactured</a></strong></th>
  22. <th style="width:90px"><strong><a href="other-items.php?order=oc_retailer">Retailer</a></strong></th>
  23. <th style="width:90px"><strong>Files</strong></th>
  24. </tr>
  25. </thead>';
  26. // Display each item
  27. while ($row = mysql_fetch_array($result)) {
  28. echo '
  29. <tr>
  30. <td style="width:250px">' . $row['oc_item'] . '</td>
  31. <td style="width:250px">' . $row['oc_itemdesc'] . '</td>
  32. <td style="width:150px">' . $row['oc_manpub'] . '</td>
  33. <td style="width:100px">' . $row['oc_model'] . '</td>
  34. <td style="width:120px">' . $row['oc_serial'] . '</td>
  35. <td style="width:30px">' . $row['oc_amount'] . '</td>
  36. <td style="width:84px">$' . $row['oc_price'] .'</td>
  37. <td style="width:110px">' . $row['oc_purchasedate'] . '</td>
  38. <td style="width:90px">' . $row['oc_pubmandate'] .'</td>
  39. <td style="width:90px">' . $row['oc_retailer'] .'</td>
  40. <td style="width:90px">
  41. if($resultset['oc_upload3']===''){
  42. echo 'fieldname was empty';
  43. }
  44.  
  45. </td>
  46. </tr>
  47. ';
  48. }
  49. echo '</table>';?>

Report this snippet  

You need to login to post a comment.