php-general Digest 9 Apr 2006 15:08:24 -0000 Issue 4062

Topics (messages 233601 through 233621):

Re: php newbie having trouble going to list page
        233601 by: David Tulloh
        233609 by: Richard Lynch

Re: Date problems
        233602 by: Rasmus Lerdorf
        233614 by: Satyam

looking for shopping cart
        233603 by: Lisa A
        233607 by: Stephen Lake
        233608 by: Stephen Lake
        233611 by: Lisa A
        233612 by: loveneesh.bansal.csipl.net
        233615 by: Stephen Lake
        233618 by: Jochem Maas
        233619 by: afan.afan.net
        233620 by: Dan McCullough
        233621 by: Ryan A

Re: Mail problems with Outlook
        233604 by: Richard Lynch

Re: Passing Variables from Script to Script
        233605 by: Richard Lynch

Re: What is best way to do handle audio files?
        233606 by: Richard Lynch
        233616 by: Nicholas Couloute
        233617 by: Dave Goodchild

Re: Timestamp needed in error log
        233610 by: Richard Lynch

Re: question about magic_quotes_gpc not adding slashes into $_GET
        233613 by: Richard Lynch

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
David Doonan wrote:
> I'm having trouble getting the correct results on a list page.
> 
> The first query is pulling the name of active authors from the d/b  and
> linking to a list page that is supposed to return essay titles by  the
> requested author. The list page however is displaying essay  titles by
> all authors.
> 
> No doubt something is wrong with the where clause in the List page 
> query. I've tried countless variations on the syntax for Author.ID = 
> Author.ID without success.
> 
> Sorry for so basic a question.
> 
> ---------------------
> author page query =
> 
> $query_GetAuthors = "SELECT Distinct Author.Autholr_Name, Author.ID, 
> Writings.Writings_Author FROM Author, Writings
> WHERE Author.Autholr_Name = Writings.Writings_Author and
>        Author.ID = Author.ID";
> ...
 > --------------------
> author page link =
> <a href="author.php?ID=<?php echo $row_GetAuthors['ID']; ?>"><?php  echo
> $row_GetAuthors['Autholr_Name']; ?></a>
> 
> 
> ---------------------
> List page query =
> 
> $query_GetAuthorList = "SELECT Writings.Writings_Author, 
> Writings.Writings_Title, DATE_FORMAT(Writings_Date, '%M %D, %Y') as 
> Writings_Date, Writings.Writings_Text, Writings.ID, 
> Author.Autholr_Name, Author.ID FROM Writings, Author
> WHERE Writings.ID = Writings.ID AND
>                 Author.Autholr_Name = Writings.Writings_Author AND
>                 Author.ID = Author.ID
> ORDER BY Writings.Writings_Date desc";
> ...


Nowhere in your query are you actually specifying which author you want
to get results for.  You need to use the variable passed to the page as
part of the query.  Try adding something like the following to your
where block.

"Author.ID = ".mysql_real_escape_string($_GET['ID'])


David

--- End Message ---
--- Begin Message ---
On Sat, April 8, 2006 10:12 am, David Doonan wrote:
> I'm having trouble getting the correct results on a list page.
>
> The first query is pulling the name of active authors from the d/b
> and linking to a list page that is supposed to return essay titles by
> the requested author. The list page however is displaying essay
> titles by all authors.
>
> No doubt something is wrong with the where clause in the List page
> query. I've tried countless variations on the syntax for Author.ID =
> Author.ID without success.
>
> Sorry for so basic a question.
>
> ---------------------
> author page query =
>
> $query_GetAuthors = "SELECT Distinct Author.Autholr_Name, Author.ID,
> Writings.Writings_Author FROM Author, Writings
> WHERE Author.Autholr_Name = Writings.Writings_Author and
>          Author.ID = Author.ID";

This gets every author several times over, then throws away the
duplicates.

Not what you want.

First thing:
WHERE Author.ID = Author.ID

This is just silly -- Author.ID will ALWAYS equal Author.ID
It's a tautology, like,  WHERE 1 = 1

Get rid of it.

Next, you really should NOT be storing the Author Name in both tables.

Suppose somebody gets married?

Suppose Cassius Clay changes his name to Mohammed Ali.

Suppose Madonna writes for you.

You should store an Author_ID field ni Writings so that you are
comparing the ID Numbers, not names that might change tomorrow.

Finally, you are JOINing the Author table and Writings table here, and
then throwing away all the info from the Writings table, just to get
the Names.

Either use JUST the author table to get JUST the names, or get BOTH
their Writings *AND* their names.

> $GetAuthors = mysql_query($query_GetAuthors, $connDerbyTrail) or die
> (mysql_error());
> $row_GetAuthors = mysql_fetch_assoc($GetAuthors);
> $totalRows_GetAuthors = mysql_num_rows($GetAuthors);
>
> --------------------
> author page link =
> <a href="author.php?ID=<?php echo $row_GetAuthors['ID']; ?>"><?php
> echo $row_GetAuthors['Autholr_Name']; ?></a>
>
>
>
> ---------------------
> List page query =
>
> $query_GetAuthorList = "SELECT Writings.Writings_Author,
> Writings.Writings_Title, DATE_FORMAT(Writings_Date, '%M %D, %Y') as
> Writings_Date, Writings.Writings_Text, Writings.ID,
> Author.Autholr_Name, Author.ID FROM Writings, Author
> WHERE Writings.ID = Writings.ID AND
>                               Author.Autholr_Name = Writings.Writings_Author 
> AND
>                               Author.ID = Author.ID
> ORDER BY Writings.Writings_Date desc";

Again, Writings.ID will ALWAYS equal Writings.ID
Author.ID will ALWAYS equal Author.ID

Matching up the names SHOULD get you just one of each, if your data is
not messed up...

> $GetAuthorList = mysql_query($query_GetAuthorList, $connDerbyTrail)
> or die(mysql_error());
> $row_GetAuthorList = mysql_fetch_assoc($GetAuthorList);
> $totalRows_GetAuthorList = mysql_num_rows($GetAuthorList);

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
Rasmus Lerdorf wrote:
Mace Eliason wrote:
Hi,

I am having troubles adding 7 days to the current date. I have been reading through php.net date() and this is what I have come up with but it doesn't work
$today = date('m/d/Y');
$nextweek = date('m/d/Y',mktime(date("m"), date("d")+7, date("Y")));

if I echo the above variables they are the same? Shouldn't the $nextweek be different?

You are thinking too much!  ;)

$nextweek = date("m/d/Y",strtotime("+7 days"));

By the way, the reason your way isn't working is because you have your arguments wrong. The first three arguments to mktime are hour, minute, second, and since you are only printing the date you lose the fact that you added 7 minutes. If you try your script just before midnight you will notice the values are different.

-Rasmus

--- End Message ---
--- Begin Message --- Timestamps are stored as seconds from a certain date. The base date differ depending on the platform, Windows use 1/1/1980 the rest 1/1/1970, but still seconds. 7 days are 7*24*60*60. Just add that much to a timestamp. It helps having a constant such as:

define ('DAY_IN_SECONDS',86400);

Satyam


----- Original Message ----- From: "Mace Eliason" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Sunday, April 09, 2006 4:14 AM
Subject: [PHP] Date problems


Hi,

I am having troubles adding 7 days to the current date. I have been reading through php.net date() and this is what I have come up with but it doesn't work
$today = date('m/d/Y');
$nextweek = date('m/d/Y',mktime(date("m"), date("d")+7, date("Y")));

if I echo the above variables they are the same? Shouldn't the $nextweek be different?

Thanks for the help

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
I need a shopping cart for a website that once I install and set up, my 
client can easily add merchandise to it.  They use Paypal.  It has to be 
very easy for them to upload images and products, prices, etc.
If anyone knows of something, please let me know.
I host my own websites, so not interested in paying a monthly fee.
thanks,
Lisa

--- End Message ---
--- Begin Message ---
Give osCommerce a try, its free and easy to use
http://www.oscommerce.com/

""Lisa A"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I need a shopping cart for a website that once I install and set up, my 
>client can easily add merchandise to it.  They use Paypal.  It has to be 
>very easy for them to upload images and products, prices, etc.
> If anyone knows of something, please let me know.
> I host my own websites, so not interested in paying a monthly fee.
> thanks,
> Lisa 

--- End Message ---
--- Begin Message ---
Give osCommerce a try, its free and easy to use
http://www.oscommerce.com/

""Lisa A"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I need a shopping cart for a website that once I install and set up, my 
>client can easily add merchandise to it.  They use Paypal.  It has to be 
>very easy for them to upload images and products, prices, etc.
> If anyone knows of something, please let me know.
> I host my own websites, so not interested in paying a monthly fee.
> thanks,
> Lisa 

--- End Message ---
--- Begin Message ---
I actually just installed OS commerce on my site, but I think it might be 
hard for my clients to upload their contents.  They need it to be real easy. 
Almost like fill in the blanks.  What do you think?
Lisa

""Stephen Lake"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Give osCommerce a try, its free and easy to use
> http://www.oscommerce.com/
>
> ""Lisa A"" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>>I need a shopping cart for a website that once I install and set up, my 
>>client can easily add merchandise to it.  They use Paypal.  It has to be 
>>very easy for them to upload images and products, prices, etc.
>> If anyone knows of something, please let me know.
>> I host my own websites, so not interested in paying a monthly fee.
>> thanks,
>> Lisa 

--- End Message ---
--- Begin Message ---
Hi,

Why donot u people visit www.indialovesu.com and see the shop cart which is
much -2 powerful than oscommerce.

U can reach to the design company at www.bsdinfotech.com
([EMAIL PROTECTED])

Regards,

Ajay
----- Original Message ----- 
From: "Lisa A" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Sunday, April 09, 2006 10:07 AM
Subject: [PHP] Re: looking for shopping cart


> I actually just installed OS commerce on my site, but I think it might be
> hard for my clients to upload their contents.  They need it to be real
easy.
> Almost like fill in the blanks.  What do you think?
> Lisa
>
> ""Stephen Lake"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Give osCommerce a try, its free and easy to use
> > http://www.oscommerce.com/
> >
> > ""Lisa A"" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >>I need a shopping cart for a website that once I install and set up, my
> >>client can easily add merchandise to it.  They use Paypal.  It has to be
> >>very easy for them to upload images and products, prices, etc.
> >> If anyone knows of something, please let me know.
> >> I host my own websites, so not interested in paying a monthly fee.
> >> thanks,
> >> Lisa
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Give osCommerce a try, its free and easy to use
http://www.oscommerce.com/

""Lisa A"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I need a shopping cart for a website that once I install and set up, my 
>client can easily add merchandise to it.  They use Paypal.  It has to be 
>very easy for them to upload images and products, prices, etc.
> If anyone knows of something, please let me know.
> I host my own websites, so not interested in paying a monthly fee.
> thanks,
> Lisa 

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
Hi,

Why donot u people visit www.indialovesu.com and see the shop cart which is
much -2 powerful than oscommerce.
U can reach to the design company at www.bsdinfotech.com

this mailing list is not a forum for advertising your companies'
products or services. probably half the members of this list work for
web development related companies; should we all send you our marketing
pitch?

--- End Message ---
--- Begin Message ---
Try CRE Loaded.
http://www.creloaded.com/
It's osCommerce shopping cart with tons of already pre-loaded
contributions (modules).

-afan


> I actually just installed OS commerce on my site, but I think it might be
> hard for my clients to upload their contents.  They need it to be real
> easy.
> Almost like fill in the blanks.  What do you think?
> Lisa
>
> ""Stephen Lake"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Give osCommerce a try, its free and easy to use
>> http://www.oscommerce.com/
>>
>> ""Lisa A"" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>>>I need a shopping cart for a website that once I install and set up, my
>>>client can easily add merchandise to it.  They use Paypal.  It has to be
>>>very easy for them to upload images and products, prices, etc.
>>> If anyone knows of something, please let me know.
>>> I host my own websites, so not interested in paying a monthly fee.
>>> thanks,
>>> Lisa
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
X-Cart, ZenCart (osCommerce like),
http://www.hotscripts.com/PHP/Scripts_and_Programs/E-Commerce/index.html

if you look in the archives you will find similar questions with a lot
better response.

On 4/8/06, Lisa A <[EMAIL PROTECTED]> wrote:
> I need a shopping cart for a website that once I install and set up, my
> client can easily add merchandise to it.  They use Paypal.  It has to be
> very easy for them to upload images and products, prices, etc.
> If anyone knows of something, please let me know.
> I host my own websites, so not interested in paying a monthly fee.
> thanks,
> Lisa
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
<CLIP>

[EMAIL PROTECTED] wrote:
> Hi,
>
> Why donot u people visit www.indialovesu.com and see the shop cart
which is
> much -2 powerful than oscommerce.
> U can reach to the design company at www.bsdinfotech.com

this mailing list is not a forum for advertising your companies'
products or services. probably half the members of this list work for
web development related companies; should we all send you our marketing
pitch?

-- </CLIP>You forgot to mention that the site (and domain name) also sucks
and the cart looks crappy,Thanks for sending us that link to bsdinfotech.com
coz now we know if ever we wantquality oursourcing to NEVER visit that site.
<SUB-Clip>should we all send you our marketing
pitch?
</SUB-Clip>Maybe we should _all_ send the spammer our marketing
pitches.....offlist :-)And yes, I do consider what he did SPAM.-Ryan

--- End Message ---
--- Begin Message ---
Because you have created ta totally BOUGS MIME email.

You've rn rough-shod over the "standards" for html enhanced (cough,
cough) email.

Use plain-text, or do a ton of research or use the MIME email classes
from http://phpclasses.org


On Sat, April 8, 2006 5:52 pm, Schalk wrote:
> Greetings All,
>
> Is there any reason why the following code will correctly set the FROM
> and Reply-to fields in Thunderbird but not Outlook? Thanks!
>
> $firstName = $_POST['Contact_FirstName'];
> $lastName = $_POST['Contact_LastName'];
> $address = $_POST['Contact_Address'];
> $homePhone = $_POST['Contact_HomePhone'];
> $bestTime = $_POST['R1'];
> $email = $_POST['Contact_Email'];
>
>
> $to = '[EMAIL PROTECTED]';
> $subject = "Request from www.helpmefindahome.info";
> $headers = "MIME-Version: 1.0\r\n".
>            "Content-type: text/html; charset=iso-8859-1\r\n".
>            "From: ".$email."\r\n".
>            "Reply-to: ".$email."\r\n".
>
>            "Date: ".date("r")."\r\n";
>
> // Compose message:
> $message = "
> <html>
> <body>
> <h1>Message From: ".$firstName. " " .$lastName.
> "</h1>
> First Name: ".$firstName."
> <br />Last Name: ".$lastName."
> <br />Address: ".$address."
> <br />Home phone: ".$homePhone."
> <br />Best time to contact: ".$bestTime."
> <br />Email: ".$email."
> </body>
> </html>
> ";
>
> // Send message
> mail($to, $subject, $message, $headers);
>
> --
> Kind Regards
> Schalk Neethling
> Web Developer.Designer.Programmer.President
> Volume4.Business.Solution.Developers
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
PHP has those variables in $argv

$argc tells you how many args there were.

$argv[0] is the actual script name, eg, myscript.php



On Sat, April 8, 2006 2:58 pm, Alan Schneider wrote:
> What is the best way to pass a variable value from one script to
> another?
>
> In unix or dos all I would need to do would be to add them just after
> the
> name of the script
>
> such as myscript.bat aaaa bbbb
>
> thanks
>
> Alan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---

If the files are constantly changing, scandir is probably as fast as
it gets...

If you rarely alter the files, do scandir once and store the results
in, say, MySQL and you can search/sort MUCH faster.

On Sat, April 8, 2006 11:01 am, Nicholas Couloute wrote:
> On my website http://www.sidekick2music.com ! I use scandir() [php
> 5.0]
> to fetch all the files which are all in subfolders of this one folder.
> like this:
> public_html/amrs/$cat/$author/*.amr
>
> $cat = different catergoried of music
> $author = Authors of the particular catergory
>
> This way isn't fast when you have over 5,000+ files.
>
> I use flatfile for everything on the site!
> site: http://www.sidekick2music.com
>
> Would it run faster if I used mysql?
> How would this be done?
> Is there another way when dealing with files and organizing them? CMS?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message --- Yea, okay looks like I am going to be using mysql cause I want an organized site by genre, author etc. I going to need some resources of mysql cause I haven't used it before! I have used flatfile for about a year now!

On Sun, 9 Apr 2006 12:02 am, Richard Lynch wrote:


If the files are constantly changing, scandir is probably as fast as
it gets...

If you rarely alter the files, do scandir once and store the results
in, say, MySQL and you can search/sort MUCH faster.

On Sat, April 8, 2006 11:01 am, Nicholas Couloute wrote:
 On my website http://www.sidekick2music.com ! I use scandir() [php
 5.0]
 to fetch all the files which are all in subfolders of this one folder.
 like this:
 public_html/amrs/$cat/$author/*.amr

 $cat = different catergoried of music
 $author = Authors of the particular catergory

 This way isn't fast when you have over 5,000+ files.

 I use flatfile for everything on the site!
 site: http://www.sidekick2music.com

 Would it run faster if I used mysql?
 How would this be done?
 Is there another way when dealing with files and organizing them? CMS?

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




--
Like Music?
http://l-i-e.com/artists.htm
~Nick Couloute
co-owner/Web Designer
Sidekick2Music.Com

--- End Message ---
--- Begin Message ---
You will probably find a great deal of list members well versed in mysql as
it meshes so well with php, so ask away old bean.

On 09/04/06, Nicholas Couloute <[EMAIL PROTECTED]> wrote:
>
> Yea, okay looks like I am going to be using mysql cause I want an
> organized site by genre, author etc. I going to need some resources of
> mysql cause I haven't used it before! I have used flatfile for about a
> year now!
>
> On Sun, 9 Apr 2006 12:02 am, Richard Lynch wrote:
> >
> >
> > If the files are constantly changing, scandir is probably as fast as
> > it gets...
> >
> > If you rarely alter the files, do scandir once and store the results
> > in, say, MySQL and you can search/sort MUCH faster.
> >
> > On Sat, April 8, 2006 11:01 am, Nicholas Couloute wrote:
> >>  On my website http://www.sidekick2music.com ! I use scandir() [php
> >>  5.0]
> >>  to fetch all the files which are all in subfolders of this one folder.
> >>  like this:
> >>  public_html/amrs/$cat/$author/*.amr
> >>
> >>  $cat = different catergoried of music
> >>  $author = Authors of the particular catergory
> >>
> >>  This way isn't fast when you have over 5,000+ files.
> >>
> >>  I use flatfile for everything on the site!
> >>  site: http://www.sidekick2music.com
> >>
> >>  Would it run faster if I used mysql?
> >>  How would this be done?
> >>  Is there another way when dealing with files and organizing them? CMS?
> >>
> >>  --
> >>  PHP General Mailing List (http://www.php.net/)
> >>  To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> > --
> > Like Music?
> > http://l-i-e.com/artists.htm
> ~Nick Couloute
> co-owner/Web Designer
> Sidekick2Music.Com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
http://www.web-buddha.co.uk
dynamic web programming from Reigate, Surrey UK

look out for e-karma, our new venture, coming soon!

--- End Message ---
--- Begin Message ---
http://php.net/set_error_handler



On Sat, April 8, 2006 10:01 am, John Hicks wrote:
> I would like to configure my PHP 4.3 to include a timestamp in its
> error
> messages.
>
> It appears that PHP defaults to no timestamp. I can't a find a
> directive
> that allows me to configure this.
>
> Do I have to recompile?
>
> I've never looked at the source before. Any pointers on where I should
> look for the error message generation?
>
> I posted a similar query a week ago and got no response.
>
> Any response would be appreciated:
>
> --Does anyone have a PHP that is configured with a timestamped error
> log?
>
> --Is there a reason not to have a timestamp?
>
> --Would you, like me, like to have the date and time in the error
> messages?
>
> Thanks,
>
> John Hicks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
That is incorrect.

There *IS* a setting for another magic_quotes_runtime, which will do
addslashes to all data coming FROM the database.

That's a particularly silly setting UNLESS your entire application
consists of taking date out of one database and shoving it into
another database -- which is extremely rare.

But, if you *DID* have such an application, and if you *DID* have
magic_quotes_runtime turned on, and if you *DID* want to echo
something out to see what it was, you'd want to use stripslashes,
because magic_quotes_runtime has added slashes to your data on its way
OUT of the database.

Bottom line:
First thing you do is drown all the laywers.
SECOND thing you do is turn magic_quotes_gpc *OFF*!
And most certainly magic_quotes_runtime should be OFF, as it's just
plain silly, really, to ever have it on.

On Sat, April 8, 2006 10:03 pm, jonathan wrote:
> that makes more sense but in that situation, I wouldn't need to
> stripslashes but most tutorials tell you that you need to
> stripslashes when echoing the row? it seems like that would be
> incorrect.
>
> On Apr 8, 2006, at 7:57 PM, Richard Lynch wrote:
>
>> On Sat, April 8, 2006 7:49 pm, jonathan wrote:
>>> I  have a server where magic_quotes_gpc is set to On. It's my
>>> understanding that this should add slashes to something like
>>> "Joe's"
>>> so that it's "Joe\'s" but when I look in the db, it is in there as
>>> Joe's. This doesn't seem like it should be the anticipated
>>> behavior.
>>
>> It DOES add the slashes to $_GET.
>>
>> But when you put the data *IN* to MySQL, MySQL "eats" the slashes --
>> In fact, MySQL *needs* the slashes to distinguish somethings:
>> ' the beginning of a string
>> \' an apostrophe embedded IN a string
>> ' the end of a string.
>>
>> So, in slow-motion:
>>
>> HTTP sends '
>> PHP Magic Quotes makes it be \'
>> MySQL sees it *INSIDE* a string like 'Joe\'s'
>> MySQL stores this internally:   Joe's
>>
>>> Is there another setting in either PHP or MySQL that will
>>> subsequently strip out slashes from magic_quotes_gpc or override
>>> this
>>> setting such that the automatic adding of slashes isn't taking
>>> place?
>>
>> Just turn Magic Quotes *OFF* and use mysql_real_escape_string
>>
>> For the love of god do *NOT* try to do *both* MagicQuotes and
>> mysql_real_escape_string and then be happy when you've got 'Joe\'s'
>> *inside* your database.
>>
>> That just means you've corrupted your data.
>>
>> TIP:
>> If you find yourself calling http://php.net/stripslashes you
>> almost-for-sure have ended up calling addslashes or some thing
>> similar
>> twice.
>>
>> --
>> Like Music?
>> http://l-i-e.com/artists.htm
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---

Reply via email to