The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once
Warning [2] Undefined array key "" - Line: 1584 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1584 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(931) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions_post.php(931) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 931 eval
/showthread.php 1117 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(931) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions_post.php(931) : eval()'d code 11 errorHandler->error
/inc/functions_post.php 931 eval
/showthread.php 1117 build_postbit
Warning [2] Undefined array key "" - Line: 1584 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1584 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(931) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions_post.php(931) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 931 eval
/showthread.php 1117 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(931) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions_post.php(931) : eval()'d code 11 errorHandler->error
/inc/functions_post.php 931 eval
/showthread.php 1117 build_postbit
Warning [2] Undefined array key "" - Line: 1584 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1584 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions.php 1588 errorHandler->error
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1117 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(931) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions_post.php(931) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 931 eval
/showthread.php 1117 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(931) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/functions_post.php(931) : eval()'d code 11 errorHandler->error
/inc/functions_post.php 931 eval
/showthread.php 1117 build_postbit





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Invalid parameter number
#1
May be a "newbie" being stupid but need help. I maintain the website for the "Anglo-Italian Family History Society" and am looking to change the access to the various pages to improve security. At the moment the site access is split between "open", "members only" & "committee only" and is controlled by the host on a protected directory basis with a single userid/password for all members and a different on for the committee. I have been asked to provide individual logins for each person etc and Userspice seems to be the solution. I am currently "playing" with it on my development system keeping the sites "page look & feel". The first thing I'm tackling is to link the Userspice "users" table with our "members" table which needs a mutual link "aifhs_id" in both tables. I have produced php code based on the Userspice code that is supposed to transfer the members details to the user table and add a default password. Hoewver I get the following error:-
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in C:\AIFHS\Klamath\users\classes\DB.php on line 62.
I have enable DEBUG in the query function in DB.php and get the following display:-
DEBUG: query(sql=INSERT INTO
Code:
users
(
Code:
email
,
Code:
username
,
Code:
password
,
Code:
fname
,
Code:
lname
,
Code:
permissions
,
Code:
join_date
,
Code:
created
,
Code:
aifhs_id
) VALUES ( ? ), params=Array ( [0] => juliegoucher@gmail.com [1] => Member_0001 [2] => $2y$12$J6vHdar6qqDCyBaVIg58i.GaDMXgplQuk2UtCCm3/hutwkLTRvhkq [3] => Julie D [4] => Goucher [5] => 1 [6] => 2002-04-01 [7] => 2018-03-05 [8] => 1 ) )
As far as I can see there are 9 table entries and 9 data items so don't understand the error. Can you more experienced people point me in the right direction?

Nello Ostacchini
  Reply
#2
There are definitely 9 parameters being passed (at least thats what it looks like), I am wondering how you have your DB query structured. Can you show us? This would be your $db->insert or $db->query statement.

Thanks!
Brandin.
  Reply
#3
Hi Brandin, Thanks for your reply. I've extracted the relevant lines of code from my script:-

$sqlu = "INSERT INTO
Code:
users
(
Code:
email
,
Code:
username
,
Code:
password
,
Code:
fname
,
Code:
lname
,
Code:
permissions
,
Code:
join_date
,
Code:
created
,
Code:
aifhs_id
) VALUES ( ? )";

$insert_memdat = array($paramsu['email'], $paramsu['username'], $paramsu['password'], $paramsu['fname'], $paramsu['lname'], $paramsu['permissions'], $paramsu['syear'], $paramsu['created'], $paramsu['aifhs_id']);

if (!$db->query($sqlu,$insert_memdat));
{
die('Error adding user: '.__LINE__);
}

Between the first & second line of code there is a chunk of code that populates the array $paramsu with the data from my "members" table and generates the password using the UserSpice code plus additional elements that I require elsewhere in the code. I did initially have the required elements listed in the db->query call but changed it to the above where I assign them to the array $insert_memdat. I get the same error whichever I adopt.

May I ask another newbie question please? Is there an explanation of the fields in the "users" table available anywhere so that I can understand what each is used for? For example I want to allow the member to be able to change the "username" from the one that is automatically generated by my "enrolment" script following their payment via PayPal. Is there some "users" setting I need to change?

Regards
Nello
  Reply
#4
Hi Brandin,
An update - I changed the $db->query to $db->insert("users",["email"=>$paramsu['email'], "username"=>$paramsu['username'], "password"=>$paramsu['password'], "fname"=>$paramsu['fname'], "lname"=>$paramsu['lname'], "permissions"=>$paramsu['permissions'], "join_date"=>$paramsu['syear'], "created"=>$paramsu['created'], "aifhs_id"=>$paramsu['aifhs_id']])

That worked so I'm happy with my work-around.
REgards
Nello
  Reply
#5
Glad to hear this, sorry I haven't had much time to help, I will keep this on my radar to look into it deeper for you to hopefully provide a more elegant solution!
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)