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

Use alternative titles for image
Select an sql field from html field and show it in another page
How to perform validation when updating a unique field using Http\Request in Laravel
strpos not working to check if a string is not inside a string (PHP)
NotFoundHttpException when editing an object
Group by in mysqli
Image insertion is working on local server but not on live server
Formatting MySQL Search Results
upload image to project directory and store other data in database with Codeigniter
XML PHP Display Loop not working
My autoloader loads the class file but gives a fatal errors for the class
PHP page to run MySQL query
Magento admin login failed on cloud server
Contact Form Bootstrap Form [duplicate]
Symfony's is valid forms always return false
Print pre formatted Array without <pre> tag

Categories

HOME
amazon-web-services
spring-data
mc
focus
lvm
cisco
bellman-ford
squirrel-sql
texas-instruments
synthesis
temperature
word2vec
data-type-conversion
sybase-ase
perfino
spreadsheetgear
points
basex
iwebbrowser2
fatfs
guice
toad
steam-web-api
commonsware-cwac
overwrite
restful-architecture
transform
nppexec
mars-simulator
llvm-ir
aurelia-http-client
iscroll
rdp
right-click
vb.net-to-c#
haar-classifier
elasticsearch-aggregation
music21
uiautomatorviewer
aurelia-fetch-client
portability
.when
ltrace
hmmlearn
adobe-reader
xcode6.4
ndk-build
dcount
system.web.optimization
gcloud-node
openseadragon
cdo.message
bbc-micro
ajaxmin
highlighting
android-async-http
mathnet
gridbaglayout
preferenceactivity
taco
android-expansion-files
stack-smash
blank-line
bjam
relational-model
artisan
prism-4
nsmutabledata
fiware-bosun
maven-shade-plugin
thoughtworks-go
symja
xml-signature
network-printers
prism.js
oxygene
windows-taskbar
sensormanager
illuminate-container
xsd2code
yii-booster
web-frameworks
background-thread
getproperty
word-frequency
websphere-6.1
getopts
upshot
css-friendly
directshow.net
simile
webresponse
icicles
main-method
datagridcolumn
objectinstantiation
parentid

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App