Private Label and Cobranded VoIP Solutions
BrainCast internet & phone based message/memo recording & reminder organization system
Internet Phone Service and Broadband Phone Service by ViaTalk

Go Back   VoIP Forums, Internet Phone Service Forums, & Web Hosting Forums > CoderForums - Programming Discussion > General Programming Issues > Programming Languages & Technologies > PHP

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-27-2002, 09:26 PM
matyee matyee is offline
Registered User
 
Join Date: Feb 2002
Posts: 2
problem with INSERT

Hi guys,

I'm having a bit of trouble inserting data into the database. I'm not sure if it's my actual insert statement or if it is that I'm not properly connected to the database. I'm just trying to enter a an email address (string) into the database.

Here's my code:

$dbh = mysql_connect ("localhost", "username", "password") or die("Could not open connection to DB server.");
mysql_select_db("database_name", $dbh) or die("Could not select the database.");

$query = "INSERT INTO survey_email VALUES ('$email')";
$result = mysql_query($query, $dbh) or die("Insert failed");

I keep getting that the die statement that my insert failed.

If you have any ideas please let me know.

Thanks
Reply With Quote
  #2  
Old 02-28-2002, 03:41 AM
matyee matyee is offline
Registered User
 
Join Date: Feb 2002
Posts: 2
I was just missing a semicolon at the end of the query. bleh!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
Forum Jump