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

PHP array_walk() expects parameter 1 to be array, null given
How to get value from url PHP [duplicate]
Laravel relationships - access the 4th table
Open link only on mobile devices in a new tab
PDF generated with mPDF not working on android
PHP condition check fail
How to retrieve username and password after getting from database to a vriable in laravel 5.2
HY000 2006 MySQL server has gone away
How to enable stem language in php?
Laravel 5.4 named route usage with route parameter
inner join with OR using codeigniter
How to make an dropdown menu to sort data from an database
How does mysqli_fetch_array work?
Yii2 model show empty logo on print_r($model->attributes). how can i get its value
Use last part of URL as a query string in PHP rather than a directory path
Codeigniter cart - add ketchup on pizza

Categories

HOME
weblogic12c
typelite
windows-10
antd
compilation
bing-search
tabs
business-intelligence
responsivevoice
jquery-select2-4
stimulsoft
trace32
bnf
google-sites
string-formatting
raml
opam
akka-persistence
neo4j.rb
ini
perfino
ipa
multi-dimensional-scaling
python-imageio
spring-annotations
boolean-logic
steam-web-api
publishing
seafile-server
gnu-classpath
apptentive
polyml
bean-validation
jslint
forms-authentication
mv
assert
rdp
opal-framework
elasticsearch-aggregation
jqgrid-asp.net
kitura
adblock
wysihtml5
cloudwatch
hibernate-ogm
watir-webdriver
http-basic-authentication
connect-direct
case-when
apache-modules
d3v4
qtextedit
cefpython
clp
always-on-top
jenkins-workflow
nsdata
android-sdcard
rails-engines
jeasyui
cortana
chicagoboss
astropy
mobilefirst-server
bootstrap-wysiwyg
org-babel
htmltidy
ecos
webmethod
aho-corasick
pageviews
radius-protocol
smips
compiler-flags
django-facebook
jquery-lazyload
axacropdf
system-requirements
kaazing
zotonic
mkannotation
sigar
data-dump
page-curl
photo-management
ccnet-config
tessellation
raw-data
cleartype
getimagesize
iphone-sdk-3.1.3

Resources

Encrypt Message