jstfsklh211 79 Light Poster

output all your variables at different points to see whats in them

jstfsklh211 79 Light Poster

your function doesn't return a statement it returns the result

$statement = $handle->prepare($sql);

you would need to return $statement for what you're attempting

mexabet commented: Good point! +3
jstfsklh211 79 Light Poster

your code shows one checkbox and 3 radios
a little unclear about what the desired result is

check your field naming you have some duplicates which is not allowed

also name your boxes better ie for a center box radio or check use 'center' in your name that combined with the row id should make selecting boxes simple

change fun() {
radio = this.name.replace (checkbox,radiobox)
radio.checked = true
}

you'll need to edit my pseudo code as it will fail

PsychicTide commented: I get your logic now, didn't make sense until pritaeas spelled out what you were saying in a different way. thanks for the response! +5
jstfsklh211 79 Light Poster

The first thing to check in your php.ini file is this

;extension=php_mysqli.dll

if you have this line in your file uncomment it by removing the semicolon then restart your webserver this tells apache to load support for mysqli

SimonIoa commented: thanks +2
jstfsklh211 79 Light Poster

you're overwritting your onload
you should have one onload function that calls both

jstfsklh211 79 Light Poster

use css display: none; will hide elements

jstfsklh211 79 Light Poster
<input name="textBox[<?php echo $myid; ?>]"

when you post this you'll get an array for each form element with key = id
$_POST['textBox'][$myid]

lps commented: nice one +4
jstfsklh211 79 Light Poster

assuming everything is on the same domain

you could just do something like
parent.window.frames["myFrame"].location.href = 'menu.page'
from within the login iframe

jstfsklh211 79 Light Poster
$sql = select Timestamp, room, device, value...
$data = $stmt->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC); 

$data should now be an array
[
    timestamp1 => [
        0 => room0 device0 value0,
        1 => room1 device1 value1
    ],
    timestamp2 => [
        0 => room0 device0 value0,
        1 => room1 device1 value1
    ]
]
diafol commented: This is better If you can use pdo +15
jstfsklh211 79 Light Poster

according to the docs rowcount is not always accurate and you shouldn't use it to check your results

go with something more like this

$records = $sth->fetchAll(PDO::FETH_ASSOC);
if($records && count($records) {
foreach ($records as $row) {
    //html here
}
} else { //no data }
jstfsklh211 79 Light Poster

post the code for your form

what method are you using to submit the form?
did you try printing out your variables to make sure you have data?

$note_sql = "UPDATE users SET customer_notes='".$customer_notes."' WHERE id='".$row."'";

$result would return true even if $row = ''

berserk commented: excellent advice for debugging +2
jstfsklh211 79 Light Poster

new PDO("mysql:host=" . $this->host . ";dbname=" . $dbn, $usr, $pwd, array(

jstfsklh211 79 Light Poster

your data should be an array

data : [["id", imgdata], ["var2", val2]]
jstfsklh211 79 Light Poster

are those pages being loaded properly by the site

check firebug/other tool to make sure your urls are correct

may seem basic but...

<M/> commented: i see +10
jstfsklh211 79 Light Poster

select table1.field1 as alias1, table2.field2 as alias2
from table1
inner join table2 on table1.field = table2.matching field

jstfsklh211 79 Light Poster
jstfsklh211 79 Light Poster

the field name is currently "count(approved)" if you dumped your results thats what you would see

count(approved) as approved would return approved as a field

jstfsklh211 79 Light Poster

do you have anything to show us

we wont do it for you but we will help you work through it

jstfsklh211 79 Light Poster

you cant use fgetcsv on xls files you would need to use something like PHPExcel

jstfsklh211 79 Light Poster

i would think so...

are you submiting them from a form? using what method?

jstfsklh211 79 Light Poster
$action = isset($_GET['action']) ? $_GET['action'] : "";
$Quantity = isset($_GET['Quantity']) ? $_GET['Quantity'] : "";
$DVDID = isset($_GET['DVDID']) ? $_GET['DVDID'] : "";
$name = isset($_GET['NameOfTheDVD']) ? $_GET['NameOfTheDVD'] : "";

where do these values come from

jstfsklh211 79 Light Poster

looks like your $_GET vars are all empty

how are you passing your variables

jstfsklh211 79 Light Poster

might not be the best solution but just read them into an array and update based on array position after reordering

jstfsklh211 79 Light Poster

cast as int to remove value after "."

then parse

jstfsklh211 79 Light Poster

add print_r($_REQUEST); to the top of your page and post the results

jstfsklh211 79 Light Poster

try adding an onmouseover='$(this).show()

jstfsklh211 79 Light Poster

just fyi placeholder is an html5 attribute

jstfsklh211 79 Light Poster

you need to change the js to only fire when empty($_POST['username'])

jstfsklh211 79 Light Poster

Clearing up php retrieval of form variables

the basics on how to best submit and retrieve form values in php focusing on checkboxes because they seem to be the most diffucult to understand.

When posting form data to another page your naming convention makes all the difference in the world in your ease of access and clarity.

Your Options
simple syntax name="simple_syntax"
array syntax name="array_syntax[]"
multi-dimensional arrays name="multi-dimensional_array_syntax[][]"

simple syntax

<form name="av" method="post" action="<?php print $_SERVER['PHP_SELF']; ?>">
    <p>Simple checkbox <input type="checkbox" name="simple_checkbox_1" value="simple_checkbox_1"/>
    <input type="checkbox" name="simple_checkbox_2" value="simple_checkbox_2"/>
    <input type="checkbox" name="simple_checkbox_3" value="simple_checkbox_3"/></p>
</form>

assuming each checkbox was checked your $_POST should now look like this

$_POST => array (
    [simple_checkbox_1] => simple_checkbox_1
    [simple_checkbox_2] => simple_checkbox_2
    [simple_checkbox_3] => simple_checkbox_3
)

any checkbox unchecked would simply not show in the results: so if checkbox 2 was not checked you $_POST would be

$_POST => array (
    [simple_checkbox_1] => simple_checkbox_1
    [simple_checkbox_3] => simple_checkbox_3
)

note: this only applies to checkboxes: if we had used text inputs the result would be

$_POST => array (
    [text_1] => text_1
    [text_2] => 
    [text_3] => text_3
)

array syntax

<form name="av" method="post" action="<?php print $_SERVER['PHP_SELF']; ?>">
    <p>Simple array checkbox <input type="checkbox" name="simple_array_checkbox[]" value="simple_array_checkbox_1"/>
    <input type="checkbox" name="simple_array_checkbox[]" value="simple_array_checkbox_2"/>
    <input type="checkbox" name="simple_array_checkbox[]" value="simple_array_checkbox_3"/></p>
</form>

assuming each checkbox was checked your $_POST should now look like this

$_POST => array (
    [simple_array_checkbox] => Array
        (
            [0] => simple_array_checkbox_1
            [1] => simple_array_checkbox_2
            [2] => simple_array_checkbox_3
        )
)

leaving one unchecked will make that …

EvolutionFallen commented: Excellent summary of a confusing topic in HTML forms. Nice job! +4
LastMitch commented: Nice Tutorial! +7
jstfsklh211 79 Light Poster

should be and department in ($dep)

or much simpler

select[fields] from t1 inner join t2 on t1.id = t2.t1id where t1.id = id
jstfsklh211 79 Light Poster

password is mysql reserved word
in order to tell mysql that you are using it as a field name you need to encase it in backticks

`password`
jstfsklh211 79 Light Poster

<a href=\"$_SERVER[PHP_SELF]?action=update\" onclick=\"return confirm('Are you sure?');\">Update Cart</a>

your not posting your form
you need to use a button or js to submit your form

@pritaeas name is fine it has the same effect

pritaeas commented: Spot on +13
jstfsklh211 79 Light Poster

".$image_id."

jstfsklh211 79 Light Poster

any time you use this syntax in a form
name="checkbox[]"
the post value in php is an array
so $_POST['checkbox'] is an array already

jstfsklh211 79 Light Poster

try parseInt(xmlDoc.getElementsByTagName("x")[0].childNodes[0].nodeValue); one be a string containing a number, one be a number