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

Learning HTML and PHP [duplicate]
Magento - Programmatically create custom product attribute via set up script
Zend 1.12 and IMAP: Create folders fails
Laravel Checking if a Dynamic property is set
How do I create pretty urls on non-index pages?
Multiple Fetching from different rows in one loop in PHP
Prestashop mobile number validation
phpSound - fb sign up/login Issue
Laravel 5 Send Errors to Email
fseek($file, SEEK_END) + fwrite() writing to beginning of file instead of end
CodeIgniter - my insert query does not work - returning error without error number
PHP editing file not working
Find a key on a multidimensional associative array and modify the array structure (PHP)
PHP - Remove an element from a stdclass array of stdclass objects
Parse Push Notification from PHP API not registering in parse.com dashboard as “opened”
Codeigniter not loading other controller

Categories

HOME
spring-data
class
xcode
mpdf
subdomain
magento-2.0
malware
google-webmaster-tools
ipv6
video-streaming
facebook-android-sdk
google-search-console
wine
squid
pinterest
office-ui-fabric
wsf
perfino
exchange-server-2010
background-color
marquee
jackrabbit-oak
sparkle
substance
netbios
windows2012
python-2.x
reporting
shapeless
om-next
autoencoder
right-click
coverage.py
dagger
contactless-smartcard
morphline
audio-converter
flume-twitter
absolute
rightnow-crm
deployd
comm
sonatype
deedle
dex
kendo-treeview
oracle-fusion-apps
streamwriter
xmlbeans
always-on-top
apache-pig-grunt
noclassdeffounderror
apple-configurator
swiffy
mnesia
vimperator
as3-api
jsr363
diawi
odesk
json-spirit
largenumber
jnlp
css-paged-media
incron
mod-auth-openidc
nanomsg
rubber
device-admin
osascript
webautomation
git-reset
csslint
lsa
infinite
insertonsubmit
tnt4j
dynamic-rdlc-generation
blobstorage
flv
chefspec
jquery-cycle
msinfo32
uitextfielddelegate
jdom
image-scanner
trialware
kobold2d
uipangesturerecognizer
flymake
nsfont
django-apps
datacontracts
simile
ognl
anonymous-types
android-2.1-eclair
multiple-users
gtktextview
index.dat
rendering-engine

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile