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

How to Display Post Expiring plugin on posts data table wordpress plugin
dropdown selection message missing PHP
how to get all parameter from foreign key entity symfony 3
PHP concatenate &para to variable
Trying to pass ajax value from php to jquery in selectize
PHP Error: T_CONSTANT_ENCAPSED_STRING [duplicate]
.htaccess Remove trailing / unless directory
Don't allow new user, if a user has already logged in
Error Fetching http headers in wsdltophp.com
function results in Notice: Undefined offset: 0 on one website but not the other
send mail in laravel 5.4 with request input
Php generated wrong format url file path after upload to server
Php PDO search string as Google or order by best match
Submitting the same value many times when the value needs to be unique
'Order by' specified order in Woocommerce shortcode
woocommerce hooks warning “function not found”

Categories

HOME
amazon-web-services
android-studio
barcode-scanner
dafny
ant
openlayers-3
fogbugz
haxe
pyresttest
xamarin-zebble
rangy
grocery-crud
heap-dump
pinterest
c#-7.0
l20n
cloudsim
xsl-fo
http-authentication
home
yii2-basic-app
hdl
gollum-wiki
ini
tortoisemerge
tracing
introspection
uilocalnotification
tsung
copy-protection
nic
overwrite
serversocket
android-canvas
busboy
des
django-crispy-forms
cloudera-quickstart-vm
game-center
access-denied
optionaldataexception
vungle-ads
sendinput
daz3d
qvtkwidget
brightscript
karabiner
http-basic-authentication
lvalue
kendo-editor
instafeedjs
nitrousio
pjax
openquery
nunit-console
traversable
jenkins-workflow
piping
right-to-left
frame-grab
sharepoint-apps
fdt
preferenceactivity
flush
cryptojs
screen-orientation
android-studio-import
apple
hmisc
mgwt
nhibernate-criteria
nanomsg
sql-processor
xml-signature
multivariate-testing
object-code
full-text-indexing
commenting
zend-search-lucene
lync-2010
san
iirf
django-facebook
tridion-2011
wndproc
server-name
jzmq
nsfont
quartz-core
dynamic-c
snackjs
database-deadlocks
libxslt
pinax
iphone-sdk-4.3
cleartype

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