tarenberg Posted September 11, 2006 Share Posted September 11, 2006 When I Post characters like ® and ™ to a SQL database from a PHP edit page ie:SQL string = INSERT INTO products (cat_id,product,pict,pict_path,description,notes,pl_no,web_no,settings,features,specs,pb,drawing,opt_acc,w_order,a_order,new) VALUES ("64","® ™ reg\'d","","","","","","","31","","","","","","","","")The resulting entry ends up being " [b]®[/b] " and " [b]â„¢[/b] ", but when I take the SQL statement:INSERT INTO products (cat_id,product,pict,pict_path,description,notes,pl_no,web_no,settings,features,specs,pb,drawing,opt_acc,w_order,a_order,new) VALUES ("64","® ™ reg\'d","","","","","","","31","","","","","","","","")and enter it into the database using phpMyAdmin the data is entered correctly, " [b]® ™[/b] ".Does anyone know how to eliminate this problem?Thanks in advanceTom Quote Link to comment Share on other sites More sharing options...
Jenk Posted September 11, 2006 Share Posted September 11, 2006 you have encoding mismatches.btw - you don't need to specify every column when you do updates..[code]INSERT INTO products (cat_id,product,settings) VALUES ("64","® ™ reg\'d","31")[/code] Quote Link to comment Share on other sites More sharing options...
R_P Posted September 11, 2006 Share Posted September 11, 2006 Try changing the datatype and collation of the table columns you expect to have these characters entered into. Honestly, I'm not an expert on datatypes so you may want to do a little research. I do know there are characters MySQL doesn't take. Take a look here:http://www.xaprb.com/blog/2006/04/14/bad-character-data-in-mysql/Also, while you don't need to specify every column in and UPDATE, you do in an INSERT, unless you have a default value assigned to that column.Happy coding. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.