process_input accesses the super-global variable $_POST. Open
function process_input() {
foreach ($_POST['member'] as $member_id => $member) {
process_user($member, $member_id);
remove_user();
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Method list_members_status_form
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function list_members_status_form($sql, $positions_options) {
include ('mysql_access.php');
$result = $db->query($sql) or exit("Error");
Avoid using undefined variables such as '$db' which will lead to PHP notices. Open
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$db' which will lead to PHP notices. Open
$result = $db->query($sql);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$db' which will lead to PHP notices. Open
$result = $db->query($sql);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$db' which will lead to PHP notices. Open
$result = $db->query($sql);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
The method list_members_status_form uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$is_exec = "";
$is_not_exec = "CHECKED";
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid unused local variables such as '$db'. Open
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
The function list_members_status_form() contains an exit expression. Open
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
Avoid unused local variables such as '$db'. Open
$result = $db->query($sql);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$db'. Open
$result = $db->query($sql);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$result'. Open
$result = $db->query($sql);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$result'. Open
$result = $db->query($sql);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$db'. Open
$result = $db->query($sql);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($filter == 'Actives') {
$sql = "SELECT * FROM `contact_information` WHERE `status` = 'Active' ORDER BY `lastname`";
} elseif ($filter == 'Inactives') {
$sql = "SELECT * FROM `contact_information` WHERE `status` = 'Inactive' ORDER BY `lastname`";
} elseif ($filter == 'board') {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 91.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 22 and the first side effect is on line 2. Open
<?php
- Exclude checks
The parameter $user_id is not named in camelCase. Open
function process_user($member, $user_id) {
include ('mysql_access.php');
$sql = "UPDATE `contact_information` SET `status` = '$member[status]', `position` = '$member[position]', `exec` = '$member[exec_access]' WHERE `id` = '$user_id' LIMIT 1";
//echo $sql . "<br/>";
$result = $db->query($sql);
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $positions_options is not named in camelCase. Open
function list_members_status_form($sql, $positions_options) {
include ('mysql_access.php');
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Expected 0 spaces before closing bracket; 1 found Open
if ($row['exec'] == 1 ) {
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
}
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
}
- Exclude checks
Line exceeds 120 characters; contains 172 characters Open
$sql = "UPDATE `contact_information` SET `status` = '$member[status]', `position` = '$member[position]', `exec` = '$member[exec_access]' WHERE `id` = '$user_id' LIMIT 1";
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$sql = "SELECT * FROM `contact_information` WHERE `status` = 'Elected' OR `status` = 'Appointed' ORDER BY `lastname`";
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
$sql = "SELECT * FROM `contact_information` WHERE `status` = 'Pledge' OR `status` = 'Pledge Exec' ORDER BY `lastname`";
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
include ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
$result = $db->query($sql) or exit("Error");
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 6 Open
$is_not_exec = "";
- Exclude checks
Space before opening parenthesis of function call prohibited Open
require_once ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 6 Open
$is_not_exec = "CHECKED";
- Exclude checks
Space before opening parenthesis of function call prohibited Open
include ('mysql_access.php');
- Exclude checks
Space before opening parenthesis of function call prohibited Open
require_once ('session.php');
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 4 Open
if ($row['exec'] == 1 ) {
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 6 Open
$is_exec = "CHECKED";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
while ($row = mysqli_fetch_array($result)) {
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 4 Open
} else {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
function list_members_status_form($sql, $positions_options) {
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 6 Open
$is_exec = "";
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
page_header();
- Exclude checks
Opening brace should be on a new line Open
function list_members_status_form($sql, $positions_options) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
function get_positions() {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
function remove_user() {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
function process_input() {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
}
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
echo "<br>";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
if ($filter == 'Actives') {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
$sql = "SELECT * FROM `contact_information` WHERE `exec` = '1' ORDER BY `lastname`";
- Exclude checks
Space before opening parenthesis of function call prohibited Open
include ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
$positions_options = "";
- Exclude checks
Space before opening parenthesis of function call prohibited Open
include ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
$sql = "SELECT * FROM `contact_information` WHERE status != 'Active' ORDER BY `lastname`";
- Exclude checks
Opening brace should be on a new line Open
function get_positions() {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$sql = "SELECT * FROM `contact_information` ORDER BY `lastname`";
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
$sql = "SELECT `position` FROM `positions`";
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
include ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
if ($_SESSION['sessionexec'] != 1) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
}elseif ($filter == 'all') {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
die(Error);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
$sql = "UPDATE `contact_information` SET `status` = '$member[status]', `position` = '$member[position]', `exec` = '$member[exec_access]' WHERE `id` = '$user_id' LIMIT 1";
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
if (isset($_GET['filter'])) {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
$sql = "SELECT * FROM `contact_information` WHERE `status` = 'Active' ORDER BY `lastname`";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
} elseif ($filter == 'poor_standing') {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
$positions_options = $positions_options . "<option>$row[position]</option>";
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
return $positions_options;
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
$sql = "SELECT * FROM `contact_information` ORDER BY `lastname`";
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
} else {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
include ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
$filter = $_GET['filter'];
- Exclude checks
Expected 1 space after closing brace; 0 found Open
}elseif ($filter == 'all') {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
$result = $db->query($sql);
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
$sql = "SELECT * FROM `contact_information` WHERE `status` = 'poor_standing'";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
while ($row = mysqli_fetch_array($result)) {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
process_input();
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
$positions_options = get_positions();
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
$result = $db->query($sql);
- Exclude checks
Space before opening parenthesis of function call prohibited Open
include ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
} elseif ($filter == 'Inactives') {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
} else {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
include ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
function process_user($member, $user_id) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
foreach ($_POST['member'] as $member_id => $member) {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
remove_user();
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
} elseif ($filter == 'exec') {
- Exclude checks
Opening brace should be on a new line Open
function remove_user() {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
process_user($member, $member_id);
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
$sql = "SELECT * FROM `contact_information` WHERE `status` = 'Inactive' ORDER BY `lastname`";
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
$sql = "SELECT * FROM `contact_information` WHERE `status` = 'Pledge' OR `status` = 'Pledge Exec' ORDER BY `lastname`";
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
$sql = "DELETE FROM `apo`.`contact_information` WHERE `contact_information`.`status` = 'REMOVE'";
- Exclude checks
Opening brace should be on a new line Open
function process_input() {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
$sql = "SELECT * FROM `contact_information` WHERE `status` = 'Elected' OR `status` = 'Appointed' ORDER BY `lastname`";
- Exclude checks
Opening brace should be on a new line Open
function process_user($member, $user_id) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
} elseif ($filter == 'pledge') {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 4 Open
echo<<<END
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 2 Open
$result = $db->query($sql);
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
}
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
echo "<div class='row'>";
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 0 Open
if (isset($_POST['submitted'])) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 2 Open
} elseif ($filter == 'board') {
- Exclude checks
The variable $is_not_exec is not named in camelCase. Open
function list_members_status_form($sql, $positions_options) {
include ('mysql_access.php');
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $member_id is not named in camelCase. Open
function process_input() {
foreach ($_POST['member'] as $member_id => $member) {
process_user($member, $member_id);
remove_user();
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $member_id is not named in camelCase. Open
function process_input() {
foreach ($_POST['member'] as $member_id => $member) {
process_user($member, $member_id);
remove_user();
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $is_not_exec is not named in camelCase. Open
function list_members_status_form($sql, $positions_options) {
include ('mysql_access.php');
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $is_exec is not named in camelCase. Open
function list_members_status_form($sql, $positions_options) {
include ('mysql_access.php');
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $positions_options is not named in camelCase. Open
function list_members_status_form($sql, $positions_options) {
include ('mysql_access.php');
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $is_not_exec is not named in camelCase. Open
function list_members_status_form($sql, $positions_options) {
include ('mysql_access.php');
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $is_exec is not named in camelCase. Open
function list_members_status_form($sql, $positions_options) {
include ('mysql_access.php');
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $positions_options is not named in camelCase. Open
function get_positions() {
include ('mysql_access.php');
$sql = "SELECT `position` FROM `positions`";
$result = $db->query($sql);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $positions_options is not named in camelCase. Open
function get_positions() {
include ('mysql_access.php');
$sql = "SELECT `position` FROM `positions`";
$result = $db->query($sql);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $positions_options is not named in camelCase. Open
function get_positions() {
include ('mysql_access.php');
$sql = "SELECT `position` FROM `positions`";
$result = $db->query($sql);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $is_exec is not named in camelCase. Open
function list_members_status_form($sql, $positions_options) {
include ('mysql_access.php');
$result = $db->query($sql) or exit("Error");
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $positions_options is not named in camelCase. Open
function get_positions() {
include ('mysql_access.php');
$sql = "SELECT `position` FROM `positions`";
$result = $db->query($sql);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $user_id is not named in camelCase. Open
function process_user($member, $user_id) {
include ('mysql_access.php');
$sql = "UPDATE `contact_information` SET `status` = '$member[status]', `position` = '$member[position]', `exec` = '$member[exec_access]' WHERE `id` = '$user_id' LIMIT 1";
//echo $sql . "<br/>";
$result = $db->query($sql);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}