top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

PHP: If I assign a variable the value of 0123, but it keeps coming up with a different number, whats the problem?

0 votes
497 views

PHP:: Suppose I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, whats the problem?

posted Jun 18, 2015 by Vrije Mani Upadhyay

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

PHP Interpreter treats numbers beginning with 0 as octal.

answer Jun 22, 2015 by Manikandan J
Similar Questions
0 votes
for($i=0;$i<=feof($getdata);$i++)
{
if (filter_var($data[$i][1], FILTER_VALIDATE_EMAIL)){
echo $data[$i][1];
$email=$data[$i][1];
$conn = mysqli_connect($dbhost,$dbuser,$dbpass, $dbname);
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}
$sql ="INSERT INTO promo_user (uid,name,email) VALUES (,'', '$email')";
mysqli_query($sql,$conn);
mysqli_close($conn);

I am using the above code but there is something wrong with it,whenever i run the code the echo is working fine but the content does go into sql table

Please help

–1 vote

I want to display the number of views of my homepage and continuously increase the views whenever a user opens that page. How to achieve this using PHP and MYSQL?

...