Skip to main content
Inspiring
September 16, 2012
Answered

create single text feild to display in select list

  • September 16, 2012
  • 1 reply
  • 5579 views

Hello, i am going round in circles with what i need to acheive. i have this on a previous post but not sure if what i was asking was correct

what i need to do is have a item size select list for the end user BUT in the backend i need to have a text feild or text feilds that can be manually changed. the db has a prod table with

ID

Desc

Price

Size

feilds, so i was thinking if it was on a single line text feild that could store all the sizes in one feild in the db and can be changed in the backend

OR

how paypal buttons do it where the backend has a add size function so you can add a set a

mount of sizes and can manually change them  is need be, beacuse i will need the backend to show if a product has sold out and wanted to be able to type "sold out" then show that in the select list

thanks in advance for any help

This topic has been closed for replies.
Correct answer sudarshan.t

yes i DO agree with you but didnt know how i am meant to do it.

the user selects an item that is sold out then sent to a new page?

thanks in advance


Not much has to change.

You can still display the result same way you would if a product is available.

The only difference would be, the item would show 'sold out'. In this case, add a conditional event listener to listen 'Sold Out' in the product status on your front-end. Echo a hyperlink to 'request form' here.

Basically, a link to 'request form' would appear only if the product is 'sold out'

1 reply

sudarshan.t
Inspiring
September 16, 2012

Comma separated values in a SQL database violates 1NF (First Normal Form) norm. It also leads to a whole lot of problems when your database is expanding.

As Bill Karwin - an author for SQL Best Practices quotes:

  • Can't ensure that each value is the right data type: no way to prevent 1,2,3,banana,5
  • Can't use foreign key constraints to link values to a lookup table; no way to enforce referential integrity.
  • Can't enforce uniqueness: no way to prevent 1,2,3,3,3,5
  • Can't delete a value from the list without fetching the whole list.
  • Hard to search for all entities with a given value in the list; you have to use an inefficient table-scan.
  • Hard to count elements in the list, or do other aggregate queries.
  • Hard to join the values to the lookup table they reference.
  • Hard to fetch the list in sorted order.

If you're still persistent in achieving this, you should use php explode function to explode your cell-data in the frontend.

Inspiring
September 16, 2012

i am not set on using one feild but need to find a solution asap. i just need to be able to change the values of the feild manually and that is the only way i can think to do it

sudarshan.t
Inspiring
September 16, 2012

Why dont you consider building a dynamic Admin CMS page to be able to update your content on the DB?