I have problems adding values to a text column as soon as "special characters" are used, like inside Ligat ha'Al. I am using php to send variables into my database. Are there any ways to "clean" this variable or convert the characters to avoid errors when submitting the data? The column in my database is utf8_unicode_ci.  I have added $conn = new PDO("mysql:host=$servername;dbname=$dbname;charset=utf8", $username, $password);, but the error still exists.  Please help! Thanks for that!
326
I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.
31406
I am planning to replace repeatedly executed Statement objects with PreparedStatement objects to improve performance. I am using arguments like the MySQL function now(), and string variables.   Most of the PreparedStatement queries I have seen contained constant values (like 10, and strings like "New York") as arguments used for the ? in the queries. How would I go about using functions like now(), and variables as arguments? Is it necessary to use the ?s in the queries instead of actual values? I am quite confounded.
89886
According to the , in order to make code more portable, they recommend using something like the following for escaping data:  if (!get_magic_quotes_gpc()) {     $lastname = addslashes($_POST['lastname']); } else {     $lastname = $_POST['lastname']; }   I have other validation checks that I will be performing, but how secure is the above strictly in terms of escaping data? I also saw that magic quotes will be deprecated in PHP 6. How will that affect the above code? I would prefer not to have to rely on a database-specific escaping function like mysql_real_escape_string().
213
Why can't I pass the table name to a prepared PDO statement?  $stmt = $dbh-&gt;prepare('SELECT * FROM :table WHERE 1'); if ($stmt-&gt;execute(array(':table' =&gt; 'users'))) {     var_dump($stmt-&gt;fetchAll()); }   Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do  $sql = "SELECT * FROM $table WHERE 1"
112694
What mysql functions are there (if any) to trim leading zeros from an alphanumeric text field?    Field with value "00345ABC" would need to return "345ABC".
80572
I have an Excel file with Unicode content of which some cells contain text inside double quotes, for example "text".   When I save the Excel file to a text file in Unicode format, the text which contains the double quote is saved as three double quotes, for example """text""".  There are some places where I even have text which contains comma (,). For example, text, which is converted into "text," in the Unicode file. It is adding double quotes to the text, which I guess contains special characters.  How can I avoid this?
7357
In SQL Server 2005, are there any disadvantages to making all character fields nvarchar(MAX) rather than specifying a length explicitly, e.g. nvarchar(255)? (Apart from the obvious one that you aren't able to limit the field length at the database level)
89192
I have some HTML I am trying to parse.  There are cases where the html attributes alone are not going to help me identify the row type (header versus data).  Fortunately, if my row is a data row then it should have some values that can be converted to integers.  I have figured out how to convert the unicode to an integer for those cases that it is possible to make the conversion.  I am struggling to write the logic to move past the cells that the conversion will not work because the cell has content that must be treated as text.  for example if rowColumn[1][3] can be converted to an integer I can do so by   int(rowColumn[1][3].replace(',','').strip('$'))   but I get an error if rowColumn[1][3] has text content.
60593
I'm trying to write a query which replaces the special characters with space. Below code helps to identify the rows. (alpha-numeric characters, comma and space is valid):  SELECT columnA FROM tableA WHERE columnA like '%[^a-Z0-9, ]%'   How can I integrate the replace function into the select statement so that all characters other than alphanumeric, comma and space in the result set are  replaced by ' ' (space). This one won't work:  SELECT replace(columnA,'%[^a-Z0-9, ]%',' ') FROM tableA WHERE columnA like '%[^a-Z0-9, ]%'
74983
I'm writing a php app to access a MySQL database, and on a tutorial, it says something of the form  mysql_connect($host, $user, $pass) or die("could not connect");   How does PHP know that the function failed so that it runs the die part? I guess I'm asking how the "or" part of it works. I don't think I've seen it before.
23809
How do I escape the underscore character?  I am writing something like the following where clause and want to be able to find actual entries with _d at the end.  Where Username Like '%_d'
121199
When I run a particular SQL script in Unix environments, I'm am seeing a '^M' character at the end of each line of the SQL script as it is echoed to the command-line.  I don't know on which OS the SQL script was originally created.  What is causing this and how do I fix it?
94051
I want to do something like this:    create table app_users (     app_user_id smallint(6) not null auto_increment primary key,     api_key     char(36) not null default uuid() );    However this results in a error, is there a way to call a function for a default value in mysql?  thanks.
112390
Is there a list describing all of the data_type parameters you can use in PDOStatement::bindParam() ? If none, what do you commonly use, and for what type of field ?  According to PHP manual: data_type Explicit data type for the parameter using the PDO::PARAM_* constants.   I know about the PDO::PARAM_INT and PDO::PARAM_STR . I've heard of PDO::PARAM_LOB but I wasn't sure how and when to use that, though. (for date ?)
60449
I see that within MySQL there are Cast() and Convert() functions to create integers from values, but is there any way to check to see if a value is an integer?  Something like is_int() in PHP is what I am looking for.
836
I'm writing a php program that pulls from a database source. Some of the varchars have quotes that are displaying as black diamonds with a question mark in them (�, , I assume from Microsoft Word text).  How can I use php to strip these characters out?
44918
I have concatenate the values of two field like  "BYKV_BTYP"  || '/' ||  "FFH"   Is it possible to draw the value of the column  "FFH" in italic if it is not empty and the value of "BYKV_BTYP"  normal? Such as  G212-6510