php


Mysql - Simple Add to cart database is being complicated.


I am stuck in a situation, I have three tables customer , stock , trolley. In customer I have fields id (pk) , username, password, date of birth.
In stock I have fields stock number , quantity , id (pk). While in the trolley I have fields cart_id (pk) ,customer_id (fk) ,paid.
Now My scenario is I want to store the stock selected by customer , in the trolley . But I dont know how it will happen. Stock table's id (pk) is auto increment and so does trolley's cart_id (pk) is auto increment. How can I store the stock selected by user and the cart id in separate table. In the end its my requirement that after saving the data , I need to store customer_id, cart_id and paid in trolley table too.

Related Links

Lose ability to use static keyword after assigning object as property [php]
PHP insert into not inserting any data
Lower versions of php complaining about brackets. Why? [duplicate]
Multilungual components / libraries
Wordpress shortcode count number of times used in post
Passing $_SESSION variable to another page through a href
Iterating through a double array in Mustache
Using asimlqt/php-google-spreadsheet-client how to check if cell is empty without triggering an error
Large POST transfer only for logged-in users?
Regular Expression Validation PHP
Selecting no item from database returns 1, why?
Execute A Function from Functions.php in Form
Undefined index (Cookie)
Search bar able to search with commas - mySQL/php
Can't write simple php code to call aws sqs
laravel syncing many-to-many relationship

Categories

HOME
spring-data
orientdb
protocol-buffers
generics
gaming
clearcase
xcode8.1
filesize
odata
dronekit-python
ag-grid
pyresttest
jpa-criteria
sap-fiori
android-externalstorage
pinterest
jqxgrid
exec-maven-plugin
string-formatting
amazon-mws
eclipse-emf
animated-gif
function-points
list-comprehension
android-service
basex
django-import-export
sparkle
bitbake
basic-authentication
audit
locks
location-services
actframework
bean-validation
rails-postgresql
busboy
subclassing
microkernel
cloudera-sentry
rightnow-crm
icecast
patternlab.io
dtd
emf-compare
maatwebsite-excel
nitrousio
boost-compute
cefpython
libharu
seccomp
conan
openseadragon
groovyfx
bbc-micro
static-methods
sharepoint-apps
ui4j
lovefield
asp.net-web-api-helppages
shoes
subfolder
jcheckbox
iplimage
sqlbindparameter
refit
zend-search-lucene
hotswap
django-settings
sensormanager
google-code-prettify
acceptance-testing
sunstudio
unicoins
rikulo
jbox2d
smartfox
xcode4.5
prototypal-inheritance
wiktionary
mmc3
startupscript
fragment-identifier
outlook-2007-addin
odac
fgetc
zend-test
jquery-effects
efs
watchpoint

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile