Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'config.php';
- $data = json_decode(file_get_contents("php://input"));
- /*$first_name= mysql_real_escape_string($data->fname);
- $last_name= mysql_real_escape_string($data->lname);
- $username= mysql_real_escape_string($data->username);
- $email= mysql_real_escape_string($data->email);
- $password= mysql_real_escape_string($data->password);*/
- $first_name= 'new first name';
- $last_name= 'new last name';
- $username= 'new username';
- $email= 'new email';
- $password='new password';
- $sql = "INSERT INTO 'account' (first_name,last_name,email,username,password) VALUES ('$first_name','$last_name','$email','$username','$password')";
- /* mysqli_query($conn, $sql); */
- if (!mysqli_query($conn,$sql))
- {
- echo("Error description: " .$sql ."<br />". mysqli_error($conn, $sql));
- }
- ?>
- <?php
- $servername= 'localhost';
- $username= 'root';
- $password= '';
- $datbase= 'angularDb';
- $conn= mysqli_connect($servername,$username,$password);
- mysqli_select_db($conn, $datbase);
- if (!$conn) {
- die('Could not connect:' . mysql_error());
- }
- echo 'Connected successfully';
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement