1

How can add two values in ':ID' separated with dot. Values are numbers, i want ':ID' to be like 1.2, 2.3 etc...

 $pdoExec = $stmt->execute(array(
                    ':username' => $_SESSION['username'],
                    ':ID' => $_SESSION['memberID'] "." $row['#'],
        ) );
0

1 Answer 1

2

Use floatval function to convert string to float value:

$pdoExec = $stmt->execute(array(
                    ':username' => $_SESSION['username'],
                    ':ID' => floatval($_SESSION['memberID']. "." .$row['#']),
        ) );
Sign up to request clarification or add additional context in comments.

3 Comments

PHP Syntax Check: Parse error: syntax error, unexpected "." (T_CONSTANT_ENCAPSED_STRING) in your code. With this, it add two number but without dot. like 12 or 23 :ID' => floatval($_SESSION['memberID'] . $row['#']),
@ValentinGjorgoski, yes, I see, check the updated fix
It's okay, fixed with two dots . "." . Thank you so much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.