Re: Apostrophe's
| From: | Ben Weinberger | Date: | Thu, 10 Aug 2000 13:56:43 +0000 |
| Subject: | Re: Apostrophe's | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11135@lists.php.net to get a copy of this message | ||
Hi~
When you inputted the data, does it have a slash in front of the apostrophe? You can use the addslashes(variable) command to make sure there is a slash in front of the data. Then, when you call the data, you should use:
SELECT count(*) from cs_studentsurvey where LearnedSchoolProgram='I didn\'t learn very much'
See if that works...
-Ben
At 01:11 AM 8/10/2000 -0500, Mike Tuller wrote:
I've looked at every document I can find in books and on the web, and still can't seem to solve this problem. Here is what I have. $Learned3 = mysql_query ("SELECT count(*) from cs_studentsurvey where LearnedSchoolProgram='I didn't learn very much'"); $Learned3results = mysql_fetch_row( $Learned3 ); print( $Learned3results[0] ); and I am getting this error. Warning: 0 is not a MySQL result index in ../count.php3 on line 134 The problem seems to be with the apostrophe. I've looked up stripslashes(), but can't find any documentation that will actually tell me how to use it.