Click here to Skip to main content
15,891,473 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Call to Member function execute() on null... Pin
Richard MacCutchan27-Feb-17 4:21
mveRichard MacCutchan27-Feb-17 4:21 
GeneralRe: Call to Member function execute() on null... Pin
samflex27-Feb-17 4:31
samflex27-Feb-17 4:31 
GeneralRe: Call to Member function execute() on null... Pin
Richard MacCutchan27-Feb-17 4:38
mveRichard MacCutchan27-Feb-17 4:38 
GeneralRe: Call to Member function execute() on null... Pin
samflex27-Feb-17 5:35
samflex27-Feb-17 5:35 
GeneralRe: Call to Member function execute() on null... Pin
Richard MacCutchan27-Feb-17 6:49
mveRichard MacCutchan27-Feb-17 6:49 
GeneralRe: Call to Member function execute() on null... Pin
Richard Deeming27-Feb-17 7:56
mveRichard Deeming27-Feb-17 7:56 
GeneralRe: Call to Member function execute() on null... Pin
samflex27-Feb-17 8:09
samflex27-Feb-17 8:09 
GeneralRe: Call to Member function execute() on null... Pin
samflex27-Feb-17 11:44
samflex27-Feb-17 11:44 
I am so close to getting it to work correctly.

Looking at this page below, I discovered the way I had the hidden form fields coded was the reason only one character of each value was getting inserted into the database.

After tweaking it, full record with full values are now getting inserted - YEA!

I still have one more issue and it is to get all records inserted instead of just the first row.

Perhaps, the hidden form fields still have something to do with it?

If anyone can spot this, I will be extremely grateful.

PHP
<?php
error_reporting(E_ALL);
//echo "DEBUG POST DATA: <pre>".print_r($_POST, 1)."
";
if(isset($_POST['submitted'])) {
if(trim($_POST['employeename']) === '') {
$nameError = 'Please enter your name.';
$hasError = true;
} else {
$employeename = $_POST['employeename'];
}
if(trim($_POST['email']) === '') {
$emailError = 'Please enter your email address.';
$hasError = true;
} else if (!preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", trim($_POST['email']))) {
$emailError = 'You entered an invalid email address.';
$hasError = true;
} else {
$email = trim($_POST['email']);
}

if(trim($_POST['ttitle']) === '') {
$nameError = 'Please enter your title.';
$hasError = true;
} else {
$ttitle = $_POST['ttitle'];
}

$rowIDs = $_POST['rowIDs'];
$row2IDs = $_POST['row2IDs'];

echo 'Employee Name: '. $employeename .'
';
echo 'Employee Title:' . $ttitle .'
';
echo 'Your email: '. $email . '
';
echo '
';


foreach ($rowIDs as $id) {
$sourcename = $_POST['sourcename' . $id];
$sourceaddress = $_POST['sourceaddress' . $id];
$income = $_POST['income' . $id];

echo 'Name: '. $sourcename . '
';
echo 'Address: '. $sourceaddress . '
';
echo 'Income: '. $income . '

';
}

foreach ($row2IDs as $id) {
$spousename = $_POST['spousename' . $id];
$spouseAddress = $_POST['spouseAddress' . $id];
$spouseIncome = $_POST['spouseIncome' . $id];

echo 'Name: '. $spousename . '
';
echo 'Address: '. $spouseAddress . '
';
echo 'spouseIncome: '. $spouseIncome . '

';
}

}
?>











Return to make changes



GeneralRe: Call to Member function execute() on null... Pin
Richard MacCutchan27-Feb-17 21:28
mveRichard MacCutchan27-Feb-17 21:28 
GeneralRe: Call to Member function execute() on null... Pin
Richard Deeming28-Feb-17 1:09
mveRichard Deeming28-Feb-17 1:09 
GeneralRe: Call to Member function execute() on null... Pin
samflex28-Feb-17 1:23
samflex28-Feb-17 1:23 
GeneralRe: Call to Member function execute() on null... Pin
Richard Deeming28-Feb-17 1:40
mveRichard Deeming28-Feb-17 1:40 
GeneralRe: Call to Member function execute() on null... Pin
samflex28-Feb-17 3:30
samflex28-Feb-17 3:30 
GeneralRe: Call to Member function execute() on null... Pin
Richard Deeming28-Feb-17 3:39
mveRichard Deeming28-Feb-17 3:39 
GeneralRe: Call to Member function execute() on null... Pin
samflex28-Feb-17 4:00
samflex28-Feb-17 4:00 
GeneralRe: Call to Member function execute() on null... Pin
Richard Deeming28-Feb-17 4:11
mveRichard Deeming28-Feb-17 4:11 
GeneralRe: Call to Member function execute() on null... Pin
samflex28-Feb-17 4:28
samflex28-Feb-17 4:28 
GeneralRe: Call to Member function execute() on null... Pin
Richard Deeming28-Feb-17 4:32
mveRichard Deeming28-Feb-17 4:32 
GeneralRe: Call to Member function execute() on null... Pin
samflex28-Feb-17 5:38
samflex28-Feb-17 5:38 
QuestionGetting "Notice: Undefined offset: 1" error (SOLVED) Pin
samflex21-Feb-17 6:12
samflex21-Feb-17 6:12 
AnswerRe: Getting "Notice: Undefined offset: 1" error Pin
Richard Deeming21-Feb-17 8:37
mveRichard Deeming21-Feb-17 8:37 
GeneralRe: Getting "Notice: Undefined offset: 1" error Pin
samflex21-Feb-17 8:46
samflex21-Feb-17 8:46 
GeneralRe: Getting "Notice: Undefined offset: 1" error Pin
Richard Deeming21-Feb-17 9:03
mveRichard Deeming21-Feb-17 9:03 
GeneralRe: Getting "Notice: Undefined offset: 1" error Pin
samflex21-Feb-17 9:12
samflex21-Feb-17 9:12 
GeneralRe: Getting "Notice: Undefined offset: 1" error Pin
Richard Deeming21-Feb-17 9:22
mveRichard Deeming21-Feb-17 9:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.