Jump to content

having trouble querying my database. Can someone please help?


Digitry Designs

Recommended Posts

Ok so I am trying to send information from a form to a data base. I keeps giving me an error, to be specific, the error for querying the database. Any suggestions? Thank you in advance.

 

<?php

$name = $_POST['name'];
$organization = $_POST['organization'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$description = $_POST['description'];

$dbc = mysqli_connect('localhost', 'root', 'password', 'my_database')
or die('We are sorry, due to extensive server overload we were unable to process your mail.');

$query = "INSERT INTO mail (name, organization, phone, email, description) " .
"VALUES ('$name', '$organization', '$phone', '$email', '$description')";

$result = mysqli_query($dbc,$query)
or die('We are sorry, your email could not be sent at this time. Please try again in a few minutes');

mysqli_close($dbc);

echo '<meta HTTP-EQUIV="REFRESH" content="0; url=../admin/digitrycms_panel.php">';

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.