Passing vars to the DB


Posted on 16th Feb 2014 07:03 pm by admin

I have 3 small testing tables:

ID TYPE
1 pepperoni
2 C. bacon
3 taco

ID TYPE
1 small
2 med
3 large

ID TYPE
1 bud
2 hef
3 mil best
4 7up
5 orange
6 coke

Each one is a select menu. How would I pass these as variables
to the MySql database with one submit button?

I could order a small pepperoni and a coke, or a large pepperoni and a coke or a bud.

How do I handle all these possibilities 1) on the php end and 2) in the sql statement?
This is part of something I have done before from just one table:
Code: $UserArr = chk_lgn($_POST['logname'],$_POST['passwd']);

$sql = "SELECT UserId ,logname FROM tblPass WHERE logname = '$lname' AND passwd = '$pass' ";

These are just general questions of concept/how to proceed. I have tried to make my question
as clear as I can, I hope I succeeded.
Thanks AL123

No comments posted yet

Your Answer:

Login to answer
141 Like 17 Dislike
Previous forums Next forums
Other forums

array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h

Problem related to Creation of PDF File?
Hi All,
I am facing a problem related to creation pdf file. when I am creating a pdf file of do

getting rid of quotes in strings
sick of trying to deal with them in multiple ways (entering in and taking from database, echoing, ec

Operator precedence assistance.
I did a quick Google search and couldn't quite find the answer I wanted in terms I could understand,

help finding hacking loopholes
i was attacked by a redirect php injection

my pc is clean of viruses

so i figure that

Extract text from string
Hi folks,

I have a string that looks like this:

aaaaaaaaaa:
bbbbbbbbbb (ccccccccc)

Snapshot from video
anyone knw how to make a snapshot maker from avi n mkv format.
for example if i give a direct lin

my two tables
table1 : col1 = topicid , col2 = topic

table2 : col1 = sentid, col2 = sentence

Cod

BI in Upstream Production operations
Appreciate if you can assist in the following areas:
1) Examples of life before and after BI i

Not sure why this script is not working?
Hi I am new to php programing and I was trying to make up a simple script like a captcha but I canno

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash