When I try to insert quotes into mysql I get an error and the PHP code I use will not insert quotes. How do I insert quotes into mysql from php?????
Quotes in MySQL
Started by dirkfirst, Jun 19 2006 02:03 PM
2 replies to this topic
#1
Posted 19 June 2006 - 02:03 PM
|
|
|
#2
Posted 19 June 2006 - 03:43 PM
You have to escape quotes with a \
There is a function in PHP that does this for you. Search php.net for it.
There is a function in PHP that does this for you. Search php.net for it.
#3
Posted 20 June 2006 - 05:05 AM
dirkFirst: Becuase quotes are operators(string) in php, using them inside of quotes isnt possible. To have php ignore a special character, use \.
so:
echo """;
^^Will give you an error, but
echo "\"";
^^will work, becuase its told to ignore the "special" in special character and just print it.
so:
echo """;
^^Will give you an error, but
echo "\"";
^^will work, becuase its told to ignore the "special" in special character and just print it.


Sign In
Create Account


Back to top









