Inserting Data, my new problem

Hello again!! Didn’t take me too long, did it?

I’m having a problem with inserting info into a database. I know it has to be something easy like I’m missing a ’ or something. I’ve been looking at tutorials and trying all different kinds of things but keep getting the ‘or die’ message after the query. Anybody got an idea?
BTW - I won’t get as intense as last post…eh?

Thank you!!

http://www.freddythunder.com/test/submit.txt

hey man. jubba helped me with this an it works perfect. it also sends me an email when a new user signs up, i ddint take that out


<?
	$name = $_POST['name'];
	$Email = "sosick@digitalosophy.com";
	$Subject = "Mailing List Sign Up";
	$Header = "From: [email]sosick@digitalosophy.com[/email]";
	$Message = "$name has signed up.";

	mail($Email, $Subject, $Message, $Header);

  	@ $db = mysql_pconnect("localhost", "un", "pw");
	  
  	if (!$db){
	echo "Error: Could not connect to database.  Please try agian later.";
	exit;
	}
    mysql_select_db("db");
	$query = "insert into mailinglist(email) values('$name')";
	$result = mysql_query($query);
	if ($result) {
		echo mysql_affected_rows()." name inserted into database.";
    }
	

	       
		
?>

Flash var is name

o i just seen u had a txt attached. lol, not sure what ur doing wrng in your code, maybe you can compare the two

any luck freddy?

No. That script sends me (numerous) emails so the php script is working, but nothing ever gets inserted into my db. I do have four fields in the database, but I don’t have to name them all in the query, do I?


$query = "insert into books(isbn, author, title, price) values('$isbn', '$author', '$title', '$price')";

yes you do … i think anyway. this is how i did another project and it works fine

You’ll have to pardon me, my PHP is so new, it’s still in the wrapper.

If I had in my create table script that I used that one of those fields is ‘userID’ and it’s on auto-increment, do I still have to input something? My guestbook one (that works fine) adds in four zeros in that space. I tried that to no avail!! Drat. Any ideas about that? I’m gonna try a few hundred more times tonight…


$query = "insert into auth(userName, userPassword) VALUES('$newUser', '$newPass')";

do me a favor, before you go nuts, try that it should def work as long as your capturing those variable names and correctly

oh and yea me too, im learining php day by day. i had a lot of trouble at first but now it’s getting a little bit easier

This is the message I got:

bobcatInsertFailed!

let me translate:
$newUser/$newPass/or die message from query

that means the two passwords entered mached and all the vars are posting correctly. It must be the empty cells that don’t get filled - maybe…

hmm, so no data got entered?

ARE YOU READY FOR A LAUGH!! IT’S A DOOZIE!!

I’m an idiot. So, have you heard about that silly little ‘case sensitivity thing’ that UNIX has goin’?

Yeah, well I guess using userID and userPassword was a bad idea. I thought of that and tried to enter my password into mysqladmin with one capitol letter. He didn’t recognize me.

So we all learned a very valuble lesson. don’t ever use capitol letters again (unless is AS :P)…

Once again - thank you Digital - VICTORY IS OURS!!

lmao, no doubt man glad to see ur up and running