0

Hey guys,

I have a question:
So... I want to do a product page with new product, edit product and delete product feature.

While I'm on the modify or the deletion page, I would like to and categorise by date-desc, asc ; by category and alphabeticaly-desc, asc the retrieved content from the db.
I would like to use <select> box which creates a link like: ?page=products&order=category.
and

if($_GET['order']==category)
{
$category = mysql_query("SELECT * FROM content ORDER BY category");

while($row = mysql_fetch_array( $category ))
{
// print the content
}
}

and so.

Is this the best way to do it with select box??

I want to do a user-side product page, where the category of products will be shown like a link (below the title of each one). And this is my big problem... My code looks like this:

$category = mysql_query("SELECT * FROM content WHERE category = '[B][I]asd[/I][/B]'");

while($row = mysql_fetch_array( $category ))
{
// print the content
}

But how can I get my category names from the db into my query?
( - something like:

mysql_query("SELECT * FROM content WHERE category = ' [B][I].$row['category'][/I][/B]'

");

I hope you understand what I would like to ask.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by karuppasamy
0

hi
do the following

1. you have to create a select box content like date and category
2. if you select the date in that select box then the result will show like
if($_GET==date)
{
$category = mysql_query("SELECT * FROM content ORDER BY date ASC OR DESC(which order you want ok)");

while($row = mysql_fetch_array( $category ))
{
// print the content
}
}

3. if you select the category

you have to dynamically create another drop down menu , what category in you category table
then you have to choose one particular category got it
now the below code will work

mysql_query("SELECT * FROM content WHERE category = ' .$row'

if you want more clear details post your php files along with sample date

enjoy.......... :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.