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">';

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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