[PHP] Getting the primary key from a MySQL insert

2004-07-16 Thread Andrew Wood
If the primary key in a MySQL DB is an autoincrementing integer, is there anyway of automatically getting it back when I do an insert in PHP. In other words taking the status returned by mysql_query and extracting the PK of the record we just entered? -- PHP General Mailing List

Re: [PHP] Getting the primary key from a MySQL insert

2004-07-16 Thread Andrew Wood
Thanks. When it says 'the last insert' is that just the last insert my PHP script did, or the last insert on the DB as a whole? On 16 Jul 2004, at 11:40, [EMAIL PROTECTED] wrote: If the primary key in a MySQL DB is an autoincrementing integer, is there anyway of automatically getting it back

[PHP] Storing text with carriage returns in MySQL

2004-07-15 Thread Andrew Wood
I'm trying to use PHP to read text from an HTML textarea form field and store in in MySQL using the longtext data type but it's cutting off everything after the first carriage return. I suspect I need to iterate through the text looking for CRs then do something? But I don't know what. Can

Re: [PHP] Storing text with carriage returns in MySQL

2004-07-15 Thread Andrew Wood
That only seems to work for quotation marks and apostrophes etc. Not carriage returns? Unless I'm missing something. On 15 Jul 2004, at 20:23, Vail, Warren wrote: http://www.php.net/manual/en/function.addslashes.php Warren Vail -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Storing text with carriage returns in MySQL

2004-07-15 Thread Andrew Wood
Umm this is very weird - I've checked the database and the string is only stored upto the first carriage return everything else appears to be missing, BUT, when I display it in the webpage (using stripslashes()) the entire original message is intact - but on a single line!!! :S On 15 Jul

Re: [PHP] Storing text with carriage returns in MySQL

2004-07-15 Thread Andrew Wood
access to the database? Could it be that your string is being stored OK, and the problem is on the retrieval end? Warren Vail -Original Message- From: Andrew Wood [mailto:[EMAIL PROTECTED] Sent: Thursday, July 15, 2004 1:22 PM To: php-gen Subject: Re: [PHP] Storing text with carriage

Re: [PHP] Session variables not working

2004-05-15 Thread Andrew Wood
:48, Andrew Wood wrote: I'm trying to set the following two vars on one page then read their values on another like this: page1.php... ob_start(); session_start(); $_SESSION['member_id'] = $member_id; $_SESSION['password'] = $password; ob_end_flush(); Where are $member_id and $password coming

[PHP] Session variables not working

2004-05-14 Thread Andrew Wood
I'm trying to set the following two vars on one page then read their values on another like this: page1.php... ob_start(); session_start(); $_SESSION['member_id'] = $member_id; $_SESSION['password'] = $password; ob_end_flush(); page2.php... ob_start(); session_start(); $member_id =

Re: [PHP] Session variables not working

2004-05-14 Thread Andrew Wood
Using a cookie which is shown in my browser as PHPSESSID Yes they're on the same domain but no there's nothing being passed accross the URL. Should there be? AW On 14 May 2004, at 21:59, John W. Holmes wrote: - Original Message - From: Andrew Wood [EMAIL PROTECTED] To: [EMAIL

Re: [PHP] Session variables not working

2004-05-14 Thread Andrew Wood
Either typing the URL directly or by using a hyperlink. On 14 May 2004, at 22:09, John W. Holmes wrote: From: Andrew Wood [EMAIL PROTECTED] Using a cookie which is shown in my browser as PHPSESSID Yes they're on the same domain but no there's nothing being passed accross the URL. Should

[PHP] Can't delete cookies

2004-02-01 Thread Andrew Wood
Can anyone fathom out why I can't get the setcookie function to delete a cookie? I'm calling it with the same arguments as I used to set it originally, but with a null string value an expiry time in the past but the cookie persistently remains in the browser. This how I set it: setcookie

[PHP] Deleting cookies won't work

2004-01-29 Thread Andrew Wood
Can anyone fathom out why I can't get the setcookie function to delete a cookie? I'm calling it with the same arguments as I used to set it originally, but with a null string value an expiry time in the past but the cookie persistently remains in the browser. This how I set it: setcookie