saadat_2003 Posted November 30, 2017 Share Posted November 30, 2017 echo '<li ><a href="sidebar.php?category='.$row["cid"].'">'.$row2["csname"].'</a></li> <?php $query3="SELECT * FROM items where category='sidebar.php?category'"; I want to use this id of href in the query to display text and image of that category id Quote Link to comment Share on other sites More sharing options...
requinix Posted November 30, 2017 Share Posted November 30, 2017 $_GET And before you do, don't put the value directly into the query. Use a prepared statement. How you do that depends on whether you're using mysqli or PDO... 1 Quote Link to comment Share on other sites More sharing options...
saadat_2003 Posted November 30, 2017 Author Share Posted November 30, 2017 using sqli Quote Link to comment Share on other sites More sharing options...
BigB Posted November 30, 2017 Share Posted November 30, 2017 @saadat_2003, did you prepare the statement like "requinix" mentioned in above post? where is the code or where you at with it? more information if you require help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.