Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product_model Auto insert


davidlarge

Recommended Posts

i have looked at the contribution from cybergost (product_model auto insert v1.0

This works fine.

is it possible to get a auto incremented model no. or model_id entered into the database automatically when entering the product.

i have searched the forum and i cannot find anything that will help

 

can someone help

 

cheers

 

Dave

Link to comment
Share on other sites

i have looked at the contribution from cybergost (product_model auto insert v1.0

This works fine.

is it possible to get a auto incremented model no. or model_id entered into the database automatically when entering the product.

i have searched the forum and i cannot find anything that will help

 

can someone help

 

cheers

 

Dave

 

Easiest would be to use the same number as the products_id. You could omit filling the filled and go back with an update just as you have retrieved the newly inserted products_id. The otehr option is more comlicated, you could steal the idea of auto-incremented order numbers for the contribution I saw recently. Basically you have an extra table, insert a value there (just one column) and then retrieve that value and use that for the model# ... this is somewhat similar to what we had to do for oracle database as for the longest time autoinsert wasn#t defined there!

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Easiest would be to use the same number as the products_id. You could omit filling the filled and go back with an update just as you have retrieved the newly inserted products_id. The otehr option is more comlicated, you could steal the idea of auto-incremented order numbers for the contribution I saw recently. Basically you have an extra table, insert a value there (just one column) and then retrieve that value and use that for the model# ... this is somewhat similar to what we had to do for oracle database as for the longest time autoinsert wasn#t defined there!

 

 

Thanks for the reply

i dont want to add any number i want it to be generated automatically, and increment on every new product

i want to use the number as a Quick find code per product.

Link to comment
Share on other sites

Thanks for the reply

i dont want to add any number i want it to be generated automatically, and increment on every new product

i want to use the number as a Quick find code per product.

 

 

I have no clue what you mean ... what about an example?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

I have no clue what you mean ... what about an example?

 

for example

i am entering a new product

i enter all the relevant product details except the model no.

when the update button is clicked i want a number to be generated incremented by one from the last number generated for the previous product.

this number is the added to the product as the model no.

or perhaps a new column could be made in the db called product ID and that number be incremented every time

Link to comment
Share on other sites

for example

i am entering a new product

i enter all the relevant product details except the model no.

when the update button is clicked i want a number to be generated incremented by one from the last number generated for the previous product.

this number is the added to the product as the model no.

or perhaps a new column could be made in the db called product ID and that number be incremented every time

 

this would be done rather similarly to what I described. You just get the last product's model and make +1 instead of using the ID ...

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

this would be done rather similarly to what I described. You just get the last product's model and make +1 instead of using the ID ...

 

Yes OK i see what you mean.

is there a code available that would do this automatically

Link to comment
Share on other sites

Yes OK i see what you mean.

is there a code available that would do this automatically

 

not that I know of!

 

But I'm sure you can steal a query somewhere and mod it!

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...