Jump to content

AlphaOneIntelligence

New Members
  • Posts

    6
  • Joined

  • Last visited

AlphaOneIntelligence's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I need help I am using cPanel with GoDaddy and on the database server section its saying: Server connection: SSL is not being used how do I add SSL to the database the website already has SSL but the databases via phpMyAdmin doesn't Here is the text I copied from phpMyAdmin of that its saying: Database server Server: Localhost via UNIX socket Server type: MySQL Server connection: SSL is not being used Documentation Server version: 5.7.43-cll-lve - MySQL Community Server - (GPL) Protocol version: 10 User: username@localhost Server charset: cp1252 West European (latin1) The bold part is what I want to change to SSL ive tried everything and searched the internet just can't figure it out, or is it really needed as all of the databases and files are protected with SSL and Passwords. If you can help that would be great Many thanks
  2. I want the results to display with the th's on the left column and the results to show on the right in another column and I want the zebra stripe design for both th and result. Here is the code: <?php // Establish a connection to the MySQL database $servername = ""; $username = ""; $password = ""; $dbname = ""; $conn = mysqli_connect($servername, $username, $password, $dbname); if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } // Collect the search query from a form input $search_query = $_POST['search_query']; // Construct an SQL query to search for data in the MySQL database $sql = "SELECT * FROM animals WHERE animal_type LIKE '%$search_query%' OR animal_breed LIKE '%$search_query%' OR colour LIKE '%$search_query%' OR owner_name LIKE '%$search_query%' OR address LIKE '%$search_query%' OR telephone LIKE '%$search_query%' OR mobile LIKE '%$search_query%' OR email LIKE '%$search_query%' OR offence LIKE '%$search_query%' OR offence_date LIKE '%$search_query%' OR offence_location LIKE '%$search_query%' OR case_status LIKE '%$search_query%' OR case_ref LIKE '%$search_query%' OR action_required LIKE '%$search_query%' OR action_taken LIKE '%$search_query%' OR microchipped LIKE '%$search_query%' OR microchip_number LIKE '%$search_query%' OR aggressive LIKE '%$search_query%' OR dangerous LIKE '%$search_query%' OR lost LIKE '%$search_query%' OR date_lost LIKE '%$search_query%' OR location_lost LIKE '%$search_query%' OR stolen LIKE '%$search_query%' OR date_stolen LIKE '%$search_query%' OR location_stolen LIKE '%$search_query%' OR found LIKE '%$search_query%' OR date_found LIKE '%$search_query%' OR location_found LIKE '%$search_query%' OR other_information LIKE '%$search_query%'"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { // Output the search results while($row = mysqli_fetch_assoc($result)) { echo "Animal Type: " . $row["animal_type"] . "<br>"; echo "Animal Breed: " . $row["animal_breed"] . "<br>"; echo "Colour: " . $row["colour"] . "<br>"; echo "Owner Name: " . $row["owner_name"] . "<br>"; echo "Address: " . $row["address"] . "<br>"; echo "Telphone: " . $row["telephone"] . "<br>"; echo "Mobile: " . $row["mobile"] . "<br>"; echo "Email: " . $row["email"] . "<br>"; echo "Offence: " . $row["offence"] . "<br>"; echo "Offence Date: " . $row["offence_date"] . "<br>"; echo "Offence Location: " . $row["offence_location"] . "<br>"; echo "Case Status: " . $row["case_status"] . "<br>"; echo "Case Ref: " . $row["case_ref"] . "<br>"; echo "Action Required: " . $row["action_required"] . "<br>"; echo "Action Taken: " . $row["action_taken"] . "<br>"; echo "Microchipped: " . $row["microchipped"] . "<br>"; echo "Microchip Number: " . $row["microchip_number"] . "<br>"; echo "Aggressive: " . $row["aggressive"] . "<br>"; echo "Dangerous: " . $row["dangerous"] . "<br>"; echo "Lost: " . $row["lost"] . "<br>"; echo "Date Lost: " . $row["date_lost"] . "<br>"; echo "Location Lost: " . $row["location_lost"] . "<br>"; echo "Stolen: " . $row["stolen"] . "<br>"; echo "Date Stolen: " . $row["date_stolen"] . "<br>"; echo "Location Stolen: " . $row["location_stolen"] . "<br>"; echo "Found: " . $row["found"] . "<br>"; echo "Date Stolen: " . $row["date_stolen"] . "<br>"; echo "Location Stolen: " . $row["location_stolen"] . "<br>"; echo "Found: " . $row["found"] . "<br>"; echo "Date Found: " . $row["date_found"] . "<br>"; echo "Location Found: " . $row["location_found"] . "<br>"; echo "Other Information: " . $row["other_information"] . "<br>"; echo "<hr>"; echo "<br>"; echo "<br>"; } } else { echo "No Results Found"; } // Close the database connection mysqli_close($conn); ?> Any help will be much appreciated, and if you could put all the code where it should be as Im new to PHP many thanks
  3. Thanks Barand, I used your method, thanks so much
  4. Can anyone provide their method of getting the results to show as a table as the results it showing now is an unreadable mess, I'd also like the following css styling as follows: Padding: 20px Border: 1px solid grey th to be in light grey Id be greatfull if someone could put the code into a table as its driving me nuts lol Here is the code for showing the results: $sql = "SELECT animal_type, animal_breed, colour, owner_name, address, telephone, mobile, email, offence, offence_date, offence_location, case_status, case_ref, action_required, action_taken, microchipped, microchip_number, aggressive, dangerous, lost, date_lost, location_lost, stolen, date_stolen, location_stolen, found, date_found, location_found, other_information FROM `animals` WHERE 1"; $result = $conn->query($sql); if ($result->num_rows > 0){ while($row = $result->fetch_assoc() ){ echo $row["animal_type"]." ".$row["animal_breed"]." ".$row["colour"]." ".$row["owner_name"]." ".$row["address"]." ".$row["mobile"]." ".$row["email"]." ".$row["offence"]." ".$row["offence_date"]." ".$row["offence_location"]." ".$row["case_status"]." ".$row["case_ref"]." ".$row["action_required"]." ".$row["action_taken"]." ".$row["microchipped"]." ".$row["microchip_number"]." ".$row["aggressive"]." ".$row["dangerous"]." ".$row["lost"]." ".$row["date_lost"]." ".$row["location_lost"]." ".$row["stolen"]." ".$row["date_stolen"]." ".$row["location_stolen"]." ".$row["found"]." ".$row["date_found"]." ".$row["location_found"]." ".$row["other_information"]."<br>"; } } else { echo "0 records"; }
  5. I only want the one record to come back but it brings back evert single record within the database. Please help, thanks Form To Fill In To Send It to the Database: <center><h1>SEARCH ANIMALS RECORDS</h1> <form action="animals-search.php" method="post"> <input type="text" name="search_query"><br> <br> <input type="submit" value="Submit"> </form></center> PHP: // Collect the search query from a form input $search = $_POST['search']; // Construct an SQL query to search for data in the MySQL database $sql = "SELECT id, animal_type, animal_breed, colour, owner_name, address, telephone, mobile, email, offence, offence_date, offence_location, case_status, case_ref, action_required, action_taken, microchipped, microchip_number, aggresive, dangerous, lost, date_lost, location_lost, stolen, date_stolen, location_stolen, found, date_found, location_found, other_information * FROM animals WHERE 1"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { // Output the search results while($row = mysqli_fetch_assoc($result)) { echo "<br> " . $row["br"] . "<br>"; echo "Animal Type: " . $row["animal_type"] . "<br>"; echo "Animal Breed: " . $row["animal_breed"] . "<br>"; echo "Colour: " . $row["colour"] . "<br>"; echo "Owner Name: " . $row["owner_name"] . "<br>"; echo "Address: " . $row["address"] . "<br>"; echo "Telephone: " . $row["telephone"] . "<br>"; echo "Mobile: " . $row["mobile"] . "<br>"; echo "Email: " . $row["email"] . "<br>"; echo "Offence: " . $row["offence"] . "<br>"; echo "Offence Date: " . $row["offence_date"] . "<br>"; echo "Offence Location: " . $row["offence_location"] . "<br>"; echo "Case Status: " . $row["case_status"] . "<br>"; echo "Case Ref: " . $row["case_ref"] . "<br>"; echo "Action Required: " . $row["action_required"] . "<br>"; echo "Action Taken: " . $row["action_taken"] . "<br>"; echo "Microchipped: " . $row["microchipped"] . "<br>"; echo "Miccrochip Number: " . $row["microchip_number"] . "<br>"; echo "Aggressive: " . $row["aggressive"] . "<br>"; echo "Dangerous: " . $row["dangerous"] . "<br>"; echo "Lost: " . $row["lost"] . "<br>"; echo "Date Lost: " . $row["date_lost"] . "<br>"; echo "Location Lost: " . $row["location_lost"] . "<br>"; echo "Stolen: " . $row["stolen"] . "<br>"; echo "Date Stolen: " . $row["date_stolen"] . "<br>"; echo "Location Stolen: " . $row["location_stolen"] . "<br>"; echo "Found: " . $row["found"] . "<br>"; echo "Date Found: " . $row["date_found"] . "<br>"; echo "Location Found: " . $row["location_found"] . "<br>"; echo "Other Information: " . $row["other_information"] . "<br>"; echo "<br> " . $row["br"] . "<br>"; echo "<hr> " . $row["hr"] . "<br><br>"; } } else { echo "No Results Found"; } // Close the database connection mysqli_close($conn); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.