Whats wrong with my query?
Posted on
16th Feb 2014 07:03 pm by
admin
I am trying to get this query to show the appropriate ticked vehicle roof height, unless no boxs are ticked then I want it to display all vehicle roof heights. However it doesn't work correctly, for example if i tick the Standard roof Height checkbox then submit the form and echo the $RoofHeight to the page I get:
Code: N/A', 'Standard Roof', 'Medium Roof', 'High Roof
The same goes if I check the medium or high roof buttons.
Did you know?Explore Trending and Topic pages for more stories like this.
If I tick the N/A button then it just returns "N/A", so why does it work for 1 tickbox but not the others?
Here is my PHP code;
Code: //display all roof height vehicles when submit button isnt pressed
if (!isset($_POST['N/ARoofHeight']) && (!$_POST['Standard Roof']) && (!$_POST['Medium Roof']) && (!$_POST['High Roof'])) {
$RoofHeight = "N/A', 'Standard Roof', 'Medium Roof', 'High Roof";
}
//N/A Roof Height Only
if (isset($_POST['Submit']) && isset($_POST['N/ARoofHeight'])) {
$RoofHeight = $RoofHeight."N/A";
}
//Standard Roof Only
if (isset($_POST['Submit']) && isset($_POST['Standard Roof'])) {
$RoofHeight = $RoofHeight."Standard Roof";
}
//Medium Roof Only
if (isset($_POST['Submit']) && isset($_POST['Medium Roof'])) {
// add comma if necessary to separate
if (!empty($RoofHeight))
{
$RoofHeight = $RoofHeight."', '";
}
$RoofHeight = $RoofHeight."Medium Roof";
}
//High Roof ONLY
if (isset($_POST['Submit']) && isset($_POST['HighRoof'])) {
// add comma if necessary to separate
if (!empty($RoofHeight))
{
$RoofHeight = $RoofHeight."', '";
}
$RoofHeight = $RoofHeight."HighRoof";
}
Can anyone see whats wrong with it?
Thanks in advance
No comments posted yet
Your Answer:
Login to answer
278
7
Other forums
Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will
Splitting Attributes
SQL> SELECT I_NAME, substr(I_NAME,1,instr(I_NAME,'O')) "First part",
substr(I_NAME, IN
Varible in trigger - refering to correct schema
Hello
Im having some issues with my trigger.
What I want to do is call opon a differ
Page doesn't expand for content
Hi. I've been testing a query I made. It's here http://lapr1.6te.net/inquerito.php
The page doesn
Creating XML with php
I need to creat an XML with php and have successfully produced a valid output.
The problem I hav
Error in write byte array into document in SM58
Hi Gurus,
Getting the following error status in Transactional RFC (SM58) ..... *Error i
article site help remaining text
Hi all hope you will be fine
I am creating a article site in this site i want to put some text on
Ball movement
I want to move a ball from one point to another and it should hit a group of balls at the other end
ORA-01655: unable to extend cluster SYS.C_FILE#_BLOCK# by 128
Hi all,
Oracle 10g. Linux.
I'm facing the below error while trying to import a dumpfil
Am I setting up my sites oldschool?
Ok,
When I create a site I open a basic template that I have created that consists of a css f