Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to mysql database #212

Open
RishiPratap opened this issue Jan 24, 2022 · 3 comments
Open

Unable to connect to mysql database #212

RishiPratap opened this issue Jan 24, 2022 · 3 comments

Comments

@RishiPratap
Copy link

//connect to the data base $db = mysqli_connect("*****","******","******","******"); $username = $_POST['name']; $userstore = $_POST['store']; $userlati = $_POST['lati']; $userlongi = $_POST['longi']; $storecategory = $_POST['category']; $userpho = $_POST['phone']; $useremail = $_POST['email']; $image = $_FILES['image']['name']; $sql = "INSERT INTO genral (username,store_name,latitude,longitude,category,user_phone,user_email,userimage) VALUES ('$username','$userstore','$userlati','$userlongi','$storecategory','$userpho','$useremail','$image')"; mysqli_query($db,$sql); //store data into db if(move_uploaded_file($_FILES['image']['tmp_name'],$target)){ $msg = "DATA UPLOADED SUCCESFULLY"; }else{ $msg = "DATA NOT UPLOADED SUCCESFULLY"; }

}
?>
PHP code to connect
image

@RishiPratap
Copy link
Author

Can you suggest example to connect to mysql

@RishiPratap
Copy link
Author

RishiPratap commented Jan 24, 2022

How to move uploaded image to folder showing error while uploading inside /images folder

@f3l1x
Copy link
Collaborator

f3l1x commented Feb 1, 2022

Hi @RishiPratap. You're doing it right from my point of view. Follow the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants