generating html from php form and MySQL

ok, here is the challenge I am facing at the moment:

I want to allow the users of my socialnetwork (SocialEngine), to access a simple form with the following fields :

number of items to select (integer)
order by (combobox)

Then, through a SQL query on the database, I will extract the items attached to the user ID (through session/user ID in SocialEngine), and I want to generate a HTML code listing the selected items with the following database entries : picture (URL), description (text), price (text) and link (URL).

This should allow a user to copy and paste the html code inside a container in an external website with link to our platform.

I hope having been clear in my explanations…?!

I am confident with the sql part and the html, but really need guidance with the php part of this!

Help appreciated by anticipation!

Regards

To be a little bit more specific, here are some details :

This is the form I want to use for the user to select the parameters :

[code]
Number of offers to display (leave blank for all offers)


Most recent offers Oldest offers Price Ascending Price Descending [/code]

Here is the SQL query :

SELECT engine4_sitestoreproduct_products.product_id, engine4_sitestoreproduct_products.title, engine4_sitestoreproduct_products.body, engine4_sitestoreproduct_products.photo_id, engine4_storage_files.storage_path FROM engine4_sitestoreproduct_products INNER JOIN engine4_storage_files ON engine4_sitestoreproduct_products.photo_id = engine4_storage_files.file_id WHERE owner_id = '5742' ORDER BY $criteria LIMIT $listlimit;

Then I want to generate a html page to display the results in rows.

Is it clearer with those explanations?

Not really. You should not be using variable names as a html name attribute, unless you understand what is going on.

From the sounds of it, you want a template that is filled dynamically with the values from the database?

Sponsor our Newsletter | Privacy Policy | Terms of Service