These links below show the codes i am using to connect to a localhost/phpmyadmin database but it fails when trying to connect to the host. Ive used my PC IP and localhost as hosts, but it still will not connect. How would i go about fixing its failure to connect.
<html>
<body>
<?php
$dbname = 'example';
$dbuser = 'root';
$dbpass = '';
$dbhost = 'localhost';
$connect = @mysqli_connect($dbhost,$dbuser,$dbpass,$dbname);
if(!$connect){
echo "Error: " . mysqli_connect_error();
exit();
}
echo "Connection Success!<br><br>";
$temperature = $_GET["temperature"];
This file has been truncated. show original
///////////////Created by Gledis Qose//////////////////
#include <WiFi.h>
#include "DHT.h"
#define DHTPIN 22
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
const char* ssid = "your_ssid";
const char* password = "your_password";
const char* host = "your_hostname";
void setup()
{
Serial.begin(115200);
Serial.println("DHT11 Output!");
dht.begin();
This file has been truncated. show original
system
Closed
August 8, 2021, 12:14am
2
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.