Jump to content

Search the Community

Showing results for tags 'where statements'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 1 result

  1. hello I am looking for help on a sql problem. Not sure if I have a statement mixed up or not but the table simply won't render. Any help would be greatly appreciated. Database name = test I have two tables table 1 = parts table 2 = parts_pricing The main recordset name is RSparts Please see my current php code - $maxRows_RSparts = 10; $pageNum_RSparts = 0; if (isset($_GET['pageNum_RSparts'])) { $pageNum_RSparts = $_GET['pageNum_RSparts']; } $startRow_RSparts = $pageNum_RSparts * $maxRows_RSparts; $colname1_RSparts = "-1"; if (isset($_GET['figno'])) { $colname1_RSparts = $_GET['figno']; } $colname2_RSparts = "-1"; if (isset($_GET['modelno'])) { $colname2_RSparts = $_GET['modelno']; } mysql_select_db($database_test, $test); $query_RSparts = sprintf("SELECT * FROM parts INNER JOIN partspricing ON partspricing.sellingprice=parts.partID WHERE figno = %s AND modelno = %s ORDERBY ACS ", GetSQLValueString($colname1_RSparts, "text"),GetSQLValueString($colname2_RSparts, "text")); $query_limit_RSparts = sprintf("%s LIMIT %d, %d", $query_RSparts, $startRow_RSparts, $maxRows_RSparts); $RSparts = mysql_query($query_limit_RSRSparts, $test) or die(mysql_error()); $row_RSparts = mysql_fetch_assoc($RSparts; if (isset($_GET['totalRows_RSparts'])) { $totalRows_RSparts = $_GET['totalRows_RSparts']; } else { $all_RSparts = mysql_query($query_RSparts, $test); $totalRows_RSRSparts = mysql_num_rows($all_RSparts); } $totalPages_RSparts = ceil($totalRows_RSparts/$maxRows_RSparts)-1; Table setup; <table> <tr> <td>Key No.</td> <td>Part Number</td> <td>Description</td> <td>QTY</td> <td>S/N Break</td> <td>Availabilty</td> <td>Price</td> </tr> <?php do { ?> <tr> <td><?php echo $row_RSparts['keyno']; ?></td> <td><?php echo $row_RSparts['partno']; ?></td> <td><?php echo $row_RSparts['description']; ?></td> <td><?php echo $row_RSparts['qty']; ?></td> <td><?php echo $row_RSparts['snbreak']; ?></td> <td><?php echo $row_RSparts['availability']; ?></td> <td><?php echo $row_RSparts['sellingprice']; ?></td> </tr> <?php } while ($row_RSparts = mysql_fetch_assoc($RSparts)); ?> If I leave out parts INNER JOIN partspricing ON partspricing.sellingprice=parts.partID the table works and renders fine or if I leave out WHERE figno = %s AND modelno = %s ORDERBY ACS the table renders fine. I am missing something here. If I leave it as is the table will not render at all. Hopefully this is something simple any help would be greatly appreciated!
  • 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.