Jump to content

Arlington

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by Arlington

  1. I know how to take simple query params and do redirects as long as the URL is in the format of "http://<domain>/<page>.php?<param>=<value>". I just take the value and do a "header ( 'Location..." and redirect. I saw a really neat redirection done on an ASP.net site ("http://grapestories.com/w?854619" redirects to "http://www.grapestories.com/wine.asp?iWine=854619") and would love to do the same in PHP.... is there a way? Without specifying a page name, and a query param name, so I can keep the URL short. Thanks!
  2. Hi, I'm trying to make two stored proc calls with mysqli_multi_query to bind a grid and a dropdown. I have followed the code example from the PHP manual, got the grid/table to bind, but I can't fetch the second result set for the dropdown. Here is my code: <? $query = "CALL ListAllItemOnRecord;"; $query .= "CALL GetListData('varietal');"; if ($db->multi_query($query)) { if ($result = mysqli_store_result($db)) { if (mysqli_num_rows($result) > 0) { ?> <table> <thead> <tr> <th align="center">Col1</th> <th align="center">Col2</th> <th align="center">Col3</th> </tr> </thead> <tbody> <? while($row = mysqli_fetch_assoc($result)) { print "<tr><td></td>"; print "<td class=\"bodybox\">".$row['field1']."</td>"; print "<td class=\"bodybox\">".$row['field2']."</td>"; print "<td class=\"bodybox\">".$row['field3']."</td></tr>"; } } $result->free(); } ?> </tbody> </table> <? //<select name="varietal"> if (mysqli_more_results($db) && mysqli_next_result($db)) { echo("test1"); if ($result = mysqli_store_result($db)) { while($row = mysqli_fetch_assoc($result)) { echo("test2"); //echo "<option value=\"$row[1]\" $selected>$row[1]</option>"; } $result->free(); } } } //</select> ?> Notice how I commented out the HTML for the dropdown. By running the code I see the grid, and then "test1" but no "test2", which leads me to think the code detected a second result set but couldn't store it. I've confirmed both stored proc calls return a result set. Am I doing something wrong in the code? Can someone please shed some light? Thanks!
×
×
  • 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.