i want to use explode url for shotening my urls
i have a url like
Expand|Select|Wrap|Line Numbers
- http://localhost/vineet/products.php?dealer_id=12&category_id=2
Expand|Select|Wrap|Line Numbers
- <?php
- $leftqry="select * from dealer_table where category_id=1";
- $leftresult=mysql_query($leftqry);
- if(mysql_num_rows($leftresult)>0)
- {
- while($leftrow=mysql_fetch_array($leftresult))
- {
- $url = 'products.php?dealer_id='. $leftrow['dealer_id'] . "&category_id=" . $leftrow['category_id'];
- list($shorturl) = explode('?', $url);
- //echo $shorturl;
- echo "<tr>";
- echo "<td>" . "<a class='leftnav' href='$shorturl'>" .$leftrow['dealer_name']. "</a></td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td style='height:1px'><img src='images/left_nav_sep_dwn.gif' alt='' width='147' height='1' /></td>";
- echo "</tr>";
- }
- }
- ?>
Expand|Select|Wrap|Line Numbers
- http://localhost/vineet/products.php
- http://localhost/vineet/products.php
- http://localhost/vineet/products.php
there i get
Expand|Select|Wrap|Line Numbers
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\xampp\htdocs\vineet\products.php on line 40
what should i write in "products.php" page so that i can get the result with url explode.
vineet