Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
k4satin
The line that crazy_chris wrote, "ALTER..." is the SQL query itself. The menu that you found is an alternative to writing your own SQL queries for us SQL-illiterate folks. When you fill out the form and save your new field, phpMyAdmin creates the query for you, and it'll look like what crazy_chris wrote. You have to do it separately for each field. If you want to write in SQL query form instead, click on 'SQL' from the menu along the top. I think that if you're writing an SQL query you can include as many fields as you want at the same time.
Okay,
I went to SQL and I see this:
Run SQL query/queries on database phones:
In the blank where I can put what I want it says: SELECT * FROM `products` WHERE 1
Do I just erase that an paste: ALTER TABLE `zencart_products` ADD `product_condition` INT NOT NULL , ADD `products_warranty` VARCHAR( 32 ) NOT NULL;
And press on GO?
Re: How-To: Add new Properties to your Products
Are you using prefixes on your database tables?
The default line you show reads products but what you say you want to add is reading zencart_products ... :unsure:
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
Ajeh
Are you using prefixes on your database tables?
The default line you show reads products but what you say you want to add is reading zencart_products ... :unsure:
Well I just copied and pasted what crazy had and changed the two things to what I want them to be. He had zencart_products in there. So what did I do wrong?
Re: How-To: Add new Properties to your Products
If the products table in your database is NOT called:
zencart_products
then you need to look and see what it is called ...
Re: How-To: Add new Properties to your Products
Ajeh,
Glad to see you've joined us in this thread! We could use someone a little more knowledgeable.
Would I mess everything up if I asigned my sku numbers as my product id's instead of using the auto-increment feature for 'products_id'? My sku numbers are alph-numeric.
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
Ajeh
If the products table in your database is NOT called:
zencart_products
then you need to look and see what it is called ...
Okay, I don't see zencart_products anywhere. I see just products and after that it has like products_image, _weight, etc. What should I do?
P.S. Could you please also reply to my other post: http://www.zen-cart.com/forum/showth...027#post414027
Thanks.
Re: How-To: Add new Properties to your Products
I think what you'd want would go more like this:
ALTER TABLE `products` ADD `products_condition` INT NOT NULL , ADD `products_warranty` VARCHAR( 32 ) NOT NULL;
You might also want to edit INT and VARCHAR. INT means integer - you'd probably want VARCHAR for your product_condition, and you can set the length of the input field in the perentheses. For products_warranty, you might use INT, if it's just going to be a number...
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
k4satin
I think what you'd want would go more like this:
ALTER TABLE `products` ADD `products_condition` INT NOT NULL , ADD `products_warranty` VARCHAR( 32 ) NOT NULL;
You might also want to edit INT and VARCHAR. INT means integer - you'd probably want VARCHAR for your product_condition, and you can set the length of the input field in the perentheses. For products_warranty, you might use INT, if it's just going to be a number...
Okay, do I need to put it where I thought I woud?
I went to SQL and I see this:
Run SQL query/queries on database phones:
In the blank where I can put what I want it says: SELECT * FROM `products` WHERE 1
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
ElBasha
Okay, do I need to put it where I thought I woud?
I went to SQL and I see this:
Run SQL query/queries on database phones:
In the blank where I can put what I want it says: SELECT * FROM `products` WHERE 1
Just delete whatever's there and add your statement ('ALTER TABLE...) I think the other stuff is there to help you create an SQL statement, but not for what you're trying to do.
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
k4satin
Would I mess everything up if I asigned my sku numbers as my product id's instead of using the auto-increment feature for 'products_id'? My sku numbers are alph-numeric.
The products_id is a control feature of Zen Cart and all of the code addresses this ...
You do not want to alter this field nor manipulate it in any way ...