Search found 6 matches

by richarddunnebsc
Mon Sep 18, 2017 3:24 am
Forum: PHP coding => General
Topic: Entering an array of values into mysql table
Replies: 0
Views: 16

Entering an array of values into mysql table

I have two html tables with initially one row each, 3 cols (one input type text, two inputs type number). The user can add more rows if necessary to both. When submitted, each col input has the same name and a [] indicating an array. For the first table, each col1 input is an element in an array, in...
by richarddunnebsc
Fri Sep 15, 2017 6:17 am
Forum: PHP coding => General
Topic: File uploaded successfully, but not listed in uploads folder
Replies: 1
Views: 31

File uploaded successfully, but not listed in uploads folder

I am trying to validate an uploaded file. I am validating step by step, etc, mine, size etc. this is the ext code $path_parts = pathinfo($file); if($path_parts['extension'] != "doc" || $path_parts['extension'] != "docx") { echo $path_parts['extension'] ."<br>"; $error[] = "File must be of type doc o...
by richarddunnebsc
Wed Sep 13, 2017 6:16 am
Forum: PHP coding => General
Topic: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column
Replies: 6
Views: 59

Re: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column

Theses are the inputs of undefined variables <select name="Sector" style="width: 100%; height: 40px; font-size: 20px;"> <option value="" selected="selected">Preferred Sector</option> <option value="">Accountancy & Finance</option> <option value="">Banking, Financial services & Insurance</option> <op...
by richarddunnebsc
Tue Sep 12, 2017 1:03 pm
Forum: PHP coding => General
Topic: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column
Replies: 6
Views: 59

Re: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column

This is the php code I have (new to pdo), I now getting undefined variables for each BindValue. if ($_SERVER['REQUEST_METHOD']=='POST') { if(isset($_POST['Submit'])) { require_once 'host.php'; $err = array(); //performing all validations and raising corresponding errors if (empty($_POST['Name'])) $e...
by richarddunnebsc
Tue Sep 12, 2017 7:09 am
Forum: PHP coding => General
Topic: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column
Replies: 6
Views: 59

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column

I have a checkbox in a form named Relocate. The value is being inserted into a Boolean(tinyint) field in a table (MySQL). I have Relocate as a field in my prepared insert query and :Relocate as a value. In the execute array statement I have "Relocate" => $Relocate . I dont't understand why I'm getti...