TechSpott - Computer and technology forums

Go Back   TechSpott - Computer and technology forums > Webmasters > Database Management > MySQL
MySQL Forum dedicated to the world's most popular open source database engine.

Reply
 
Thread Tools Display Modes
Old April 16th, 2010, 11:16 PM   #1 (permalink)
24JJ24
Guest
 
Posts: n/a
Default MySQL Insert Query Issue?

Hi,

I have a problem inserting some data into a table in my database.

It seems to register that I am trying to put some data in, because it creates a new field and increments it by one.

However, it does not insert any data into the fields I have asked it to. Could anyone fix this insert query?

// 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");

//Define Variables
$email = clean($HTTP_POST_VARS['Email1']);
$firstname = clean($HTTP_POST_VARS['FirstName']);
$lastname = clean($HTTP_POST_VARS['LastName']);
$passone = clean($HTTP_POST_VARS['Password1']);
$passtwo = clean($HTTP_POST_VARS['Password2']);
$newsletter = clean($HTTP_POST_VARS['Newsletter']);

//Insert into Customers Table

$insert = "insert into " . $tbl_name . " (`customers_firstname`, `customers_lastname`, `customers_email_address`, `customers_username`, `customers_password`, `customers_newsletter`) values ('" .$email. "', '" .$firstname. "', '" .$lastname. "', '" .$passone. "', '" .$passtwo. "', '" .$newsletter. "')";
原帖地址: TechSpott - Computer and technology forums http://www.techspott.com//showthread.php?p=7829

$accountinsert = mysql_query($insert);


Many thanks
  Reply With Quote Share with Facebook
Reply

Bookmarks

Tags
insert, issue, mysql, query


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
security content of QuickTime 7.6.6 News Bot News 0 April 16th, 2010 04:32 AM
Oracle Announces MySQL Cluster 7.1 News Bot News 0 April 13th, 2010 09:47 PM
what is the mysql query to store images? Santhosh MySQL 1 April 4th, 2010 03:00 AM
How do you insert data into multiple tables into a MySQL database using JSP? monkeyboysr2002 MySQL 0 April 2nd, 2010 01:57 AM
Apple patches Safari vulnerabilities ahead of Pwn2Own amitash News 0 March 12th, 2010 03:27 PM

 
Forum Stats
Members: 14,322
Threads: 20,328
Posts: 27,675
Total Online: 36

Newest Member: noupenusetell

Latest Threads

Advertisements

Support our advertisers!

Amazon
Sears
Macys
1800flowers.com
Drugstore.com


Carbonite Online-Backups
Tiger Direct
Tech Depot
Buy.com
Office Depot
Fatcow
HostGator


TripsNow.us
Marriott
Expedia
CheapTickets.com
OneTravel
Hotwire

Are you a Fan?

Share this on Facebook

Tag Cloud

Partner Links


Contact Us - Home - Archive - Privacy Statement - Top - Copyright © 2009-2010, TechSpott - All times are GMT -4. Time is 05:41 AM

Powered by vBulletin® Copyright © Jelsoft Enterprises Ltd. :: SEO by vBSEO