we've got an issue on our new test site that i'd like you to be able to solve;

we have product pages; example page:
http://www.printsmarter.co.uk/newPrinttest/34-Brochures.html

there is a selection of menus on the screen that you can change select different options to show you a price.

issue is as follows; i want to be able to create url's for every product in the database for google adword purposes; for example if they click on the google ad they come direct to the page/selection from the table/drop downs that is what they want. currently we have got as far as creating the below link;

http://www.printsmarter.co.uk/newPrinttest/product.php?id=19&t=brochures&cat=34

this link will take you to the product, but the drop downs from the menus haven't changed, just the price and the quantity.

i need to know of a way of selecting from the database and it be able to change the drop downs from a specific url.

our problem is we need to populate a select option in order of the one we send.

possible?

hope that makes sense!

Ok I think im getting you. By default you already have all the information saved within your db im assuming.

So why don't you try something long these lines;

<?php

$recordId = $_GET['id'];

$query="SELECT * FROM products WHERE id='$recordId'";
$result=mysql_query($query);
$num=mysql_numrows($result); 
mysql_close();


	$i=0;
	while ($i < $num) {
	
	$f1=mysql_result($result,$i,"data");
	$f2=mysql_result($result,$i,"data2");
	$f3=mysql_result($result,$i,"data3");
	$f4=mysql_result($result,$i,"data4");


++$i;
} 

	if ( empty($f1) ) $f1 = "";

?>

<select id="item3" name="item3" value="<?php echo $f1; ?>">
    <option value="'170gsm matt'">170gsm matt</option>
    <option value="'150gsm gloss'">150gsm gloss</option>
    <option value="'130gsm gloss'">130gsm gloss</option>
</select>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.