Jump to content

[SOLVED] Cannot insert into table?


lt40

Recommended Posts

hi,

Could you tell me what is wrong with this code.

after the post data is submitted nothing changed in phpmyadmin.

Note: some of the post data will be blank will this still work?

 

 

<?php
include 'includes/header.inc';
include 'includes/config.php';

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");



mysql_query("INSERT INTO contact (app_code, name, sub, contact, what, email)
VALUES ('" . $_POST['app'] . "','" . $_POST['name'] . "','" . $_POST['subject'] . "','" . $_POST['contact'] . "','" . $_POST['info'] . "','" . $_POST['email'] . "')");


include 'includes/footer.inc';

?>

 

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/110052-solved-cannot-insert-into-table/
Share on other sites

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.