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

Is a combination of credit card's number and expiration date unique? [closed]
Div not expanding with it's child's table
MySQL or SQLITE to store who voted
Save model instance doesn't work in Yii
How to match everything (including new line) up to the first occurance of a substring?
session_start() not working and only page loding not showing any message
Php random String Ascii
Cakephp 2 using post data can't login properly
Php Arrays Group and Sum [closed]
Not able to access mysql server using workbench on local network connection
Live php Error logs on Windows
php ssh password on server
How to avoid putting a file name in post data?
remove woocommerce link when cart is empty
Codeigniter - Default template's PHP code is not executed
How combine the data connected by a linking/associate table into one column of a query?

Categories

HOME
jboss
artificial-intelligence
mc
antd
haproxy
out-of-memory
header
responsive-design
lc3
dma
texas-instruments
rest-assured
sharedpreferences
multi-upload
pymongo
ava
unordered-multimap
oracleforms
annotation-processing
d3.js-v4
argv
cucumber-junit
android-collapsingtoolbar
apptentive
directfb
xerces-c
busboy
testlink
mv
assert
selenide
spring-restcontroller
aws-kinesis-firehose
nothing
ol3-google-maps
uiautomatorviewer
mobile-angular-ui
dblink
emacs25
.when
openerp-6
fitbit
elastic4s
scheduledexecutorservice
nsrunloop
xcode8-beta4
piping
trust
webgrind
pack
ajax4jsf
helm
smart-tv
apache-commons-digester
wlanapi
sablecc
nsmutabledata
htmltidy
rebar
iodocs
igor
jquery-mobile-flipswitch
fileshare
mod-perl
ctp
colon
boinc
application-server
ember-table
ldif
significant-digits
will-paginate
motodev-studio
winsxs
page-curl
mediacontroller
qcar-sdk
mygeneration
solandra
iphone-sdk-4.3
rawcontacts
source-code-protection
ning
gui-designer
word-automation
parentid

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App