Re: Fw: Help, Insert not working.
Would you care to elaborate on that - Using PHP there is no error or return code - it just goes along happily saying the record was inserted. If there is a way to do this, please explain. TIA - Original Message - From: "gerald_clark" <[EMAIL PROTECTED]> To: "C. Reeve" <[EMAIL PROTECTED]> Cc: "MySQL List" <[EMAIL PROTECTED]> Sent: Thursday, March 27, 2003 9:32 AM Subject: Re: Fw: Help, Insert not working. > Try reading your return codes. > You got a duplicate key error that you were ignoring. > C. Reeve wrote: > > >I got it - stupid me has a unique field that I wasn't using in the test > >script I was using - so every I tried to add an entry this field was a > >duplicate and as such did not add the record. Is there a way to put > >something in so mysql would tell me this - 2 hours pissing around for an > >oversight. > > > >TIA > > > >- Original Message - > >From: "C. Reeve" <[EMAIL PROTECTED]> > >To: "MySQL List" <[EMAIL PROTECTED]> > >Sent: Thursday, March 27, 2003 1:47 AM > >Subject: Help, Insert not working. > > > > > > > > > >>Can anyone explain why this isn't working? It will not input the info into > >>the database. > >> > >>$db = mysql_connect($serverhost, $serveruser, $serverpass); > >>mysql_select_db($database_name); > >> > >>The variables in the above two rows are correct - I can do selects and it > >>works fine. > >> > >>This is the data to be inserted and they are there > >> > >> echo "".$entered_email; > >> echo "".$entered_passwd; > >> echo "".$name; > >> > >>Nothing happens. > >> > >> mysql_query ("INSERT INTO userdata (email, passwd, firstname, alias) > >> > >> > >VALUES > > > > > >>('$entered_email','$entered_passwd','$name','Hello')"); > >> > >> > >>TIA > >> > >> > >> > >> > > > > > > > > > > > > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Fw: Help, Insert not working.
On 27-Mar-2003 C. Reeve wrote: > I got it - stupid me has a unique field that I wasn't using in the test > script I was using - so every I tried to add an entry this field was a > duplicate and as such did not add the record. Is there a way to put > something in so mysql would tell me this - 2 hours pissing around for an > oversight. > > TIA > > mysql_query ("INSERT INTO userdata (email, passwd, firstname, alias) VALUES > ('$entered_email','$entered_passwd','$name','Hello')"); > or die('Database error :', mysql_errno(), mysql_error(), ''); Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. (53kr33t w0rdz: sql table query) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Fw: Help, Insert not working.
Try reading your return codes. You got a duplicate key error that you were ignoring. C. Reeve wrote: I got it - stupid me has a unique field that I wasn't using in the test script I was using - so every I tried to add an entry this field was a duplicate and as such did not add the record. Is there a way to put something in so mysql would tell me this - 2 hours pissing around for an oversight. TIA - Original Message - From: "C. Reeve" <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Sent: Thursday, March 27, 2003 1:47 AM Subject: Help, Insert not working. Can anyone explain why this isn't working? It will not input the info into the database. $db = mysql_connect($serverhost, $serveruser, $serverpass); mysql_select_db($database_name); The variables in the above two rows are correct - I can do selects and it works fine. This is the data to be inserted and they are there echo "".$entered_email; echo "".$entered_passwd; echo "".$name; Nothing happens. mysql_query ("INSERT INTO userdata (email, passwd, firstname, alias) VALUES ('$entered_email','$entered_passwd','$name','Hello')"); TIA -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Fw: Help, Insert not working.
I got it - stupid me has a unique field that I wasn't using in the test script I was using - so every I tried to add an entry this field was a duplicate and as such did not add the record. Is there a way to put something in so mysql would tell me this - 2 hours pissing around for an oversight. TIA - Original Message - From: "C. Reeve" <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Sent: Thursday, March 27, 2003 1:47 AM Subject: Help, Insert not working. > Can anyone explain why this isn't working? It will not input the info into > the database. > > $db = mysql_connect($serverhost, $serveruser, $serverpass); > mysql_select_db($database_name); > > The variables in the above two rows are correct - I can do selects and it > works fine. > > This is the data to be inserted and they are there > >echo "".$entered_email; >echo "".$entered_passwd; >echo "".$name; > > Nothing happens. > > mysql_query ("INSERT INTO userdata (email, passwd, firstname, alias) VALUES > ('$entered_email','$entered_passwd','$name','Hello')"); > > > TIA > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]