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 do I embed a signature within an AuthNRequest for SAML 2.0 SSO in php
Running Codeception Tests with the Selenium JAR and WebDriver on Separate Machines
Output Query into CSV from Wordpress
mysqli_query insert with localhost, table not updating
PHP PDO How to extract MySQL data to multidimensional array without number keys inside
PHP - Difference in creating variable variables with brackets or double dollar signs?
Query would run directly on MySQL but not through PHP
Match exact word with any character regex
Lost data while converting image png to base64 string
Counting IP addresses in PHP with MySQL
cURL using info from mySQL, then storing the cURL'ed info (articles and guides is much appreciated!)
Stylesheets not loading after mod_rewrite
How to register a Delegator Factory for a Hydrator in Zend Framework 2?
PDO::fetchAll() not returning records when using FETCH_ALL
How to execute a PostgreSQL PREPARE query with IN () parameters
Adding PHP to HEREDOC

Categories

HOME
cocoapods
opencart
functional-programming
exchange-server
qc
postgresql-9.4
visual-studio-2010
liferay-7
lvm
header
google-sheets-query
tfs2015
visualforce
share
static-analysis
kurento
specifications
lc3
sap-fiori
grocery-crud
stimulsoft
supervisord
fosuserbundle
playframework-2.0
gmp
psql
adminlte
stackexchange.redis
generator
websphere-portal
quartz.net
nurbs
ipa
code-climate
adapter
envoy
epplus
cloveretl
devtools
jfxtras
vb.net-to-c#
secure-coding
google-prediction
elasticsearch-aggregation
liteide
windows-media-player
watir-webdriver
nslayoutconstraint
rcharts
nrf51
yargs
haraka
logical
carmen
coovachilli
qtcpsocket
android-sdcard
adp
node-glob
sharepoint-apps
wif4.5
wikimedia-commons
flask-security
wepay
myfaces
grinder
json-spirit
embeddedwebserver
componentart
python-curses
mxe
xml-signature
rails-api
thruway
sqlbindparameter
armv6
jmenubar
compiler-flags
infinite
frontbase
mute
quickgraph
pacman
spiral
background-thread
email-verification
word-frequency
prefuse
css-friendly
nsconnection
regression-testing
cassini
icicles
urchin
raw-data
asdoc
facebook-fbml
tacit-programming
iphone-sdk-3.1.3

Resources

Encrypt Message