By Mohit Singla
Sir, i have created a droplet.
Now i wanna to use some of my php files. which are present on local.
Now i have uploaded on the Digital Ocean Server and they are Showing HTTP 500 Error.
I have changed the connection to Mysqli, which is working fine.
Some of my function like mail() is not working.
I don;t know why mysql connection or code is not working. So please let me know the solution for it if any body knows.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This comment has been deleted
Solved whit this
<?php $mysqli = new mysqli(“localhost”, “my_user”, “my_password”, “world”);
/* check connection */ if (mysqli_connect_errno()) { printf(“Connect failed: %s\n”, mysqli_connect_error()); exit(); }
$query = “SELECT CURRENT_USER();”; $query .= “SELECT Name FROM City ORDER BY ID LIMIT 20, 5”;
/* execute multi query / if ($mysqli->multi_query($query)) { do { / store first result set / if ($result = $mysqli->store_result()) { while ($row = $result->fetch_row()) { printf(“%s\n”, $row[0]); } $result->free(); } / print divider */ if ($mysqli->more_results()) { printf(“-----------------\n”); } } while ($mysqli->next_result()); }
/* close connection */ $mysqli->close(); ?>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.