hi all
i want to use explode url for shotening my urls
i have a url like
http://localhost/vineet/products.php?dealer_id=12&category_id=2
This is my navigation php code that has url explode function in while statement
<?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>";
}
}
?>
after url explode function i get the short url as
http://localhost/vineet/products.php
http://localhost/vineet/products.php
http://localhost/vineet/products.php
and when i click on these links i am redirected to products.php but i m not able to view the content related to dealer_id and category_id.
there i get
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\xampp\htdocs\vineet\products.php on line 40
otherwise without using this method i m getting all the results fine.
what should i write in products.php page so that i can get the result with url explode.
vineet