w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Mysql query - couldn't add single quotes within the another single quotes
SET @pid = $memberID = getLoggedId(); $iPid = $GLOBALS['MySQL']->getOne("SELECT `Pid` FROM `Profiles` WHERE `ID` = '$memberID' LIMIT 1"); if($iPid==1){ echo '<div id="id" style="margin:10px 10px 0;" overflow: "hidden;"> <button class="bx-btn bx-btn-img" onclick = "window.open(inviteteacher.php,_self)"> Study with Private Teacher </button> </div>'; }

Categories : PHP

SQL Server Management Studio replacing single quotes with double quotes when modifying stored procedure
I believe you are getting dynamic SQL from the scripting options because you have this option selected: Tools > Options > SQL Server Object Explorer > Scripting > Check for object existence When this setting is enabled, the script is generated like this: IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = ...) BEGIN EXEC dbo.sp_executesql @statement = N'ALTER PROCEDURE...' END Disable this option, and it should be correct when you use right-click > Modify or right-click > Script stored procedure as > ALTER to >.

Categories : Sql Server

Double quotes inside single quotes in oracle statement
I don't think the problem comes from your column name, as shown in this working example: SQL> CREATE TABLE trytable (ID VARCHAR2(10), "DEFAULT" NUMBER); Table created SQL> BEGIN 2 EXECUTE IMMEDIATE 3 'INSERT INTO trytable (ID, "DEFAULT") VALUES (''monkey1'', 0)'; 4 END; 5 / PL/SQL procedure successfully completed Technically, you can have a table column name named DEFAULT, even if it's generally a bad idea that will lead to confusion. You will only be able to interact with it through the double-quote " syntax because DEFAULT is a reserved word. If you specify double quotes around identifiers, Oracle will treat them as case-sensitive, so you have to make sure that they match the table specs. In your case, it would help to have the specific error message.

Categories : Oracle

Why do I have to escape double quotes in my string surrounded by single quotes?
Looks like you are missing semicolon ; at the end of your variable assignment. It should be: $weapon_secondary = '<select name="weapon" class="dropdown"> <option>Option 1</option> <option>Option 2</option> </select>'; As an alternative you can use heredoc to declare a variable and avoid this quoting exercise: $weapon_secondary <<< EOF <select name="weapon" class="dropdown"> <option>Option 1</option> <option>Option 2</option> </select> EOF;

Categories : PHP

Vim: Put newlines around '{' and '}' but not around those inside strings with single quotes or double quotes
One suggestion perhaps, without posting vimscript (though I cannot think of a regex that will do this in one pass) is to decide upon some marker scheme (I prefer 3 hashes) and do it in stages. I will be back later with the correct regex (the commands I'm familiar with are not working so well on my windows gvim install) Step 1: With a regex that searches for anything of the form .*["||'].*{.*}.*["||'] (i.e. braces inside quotes) prepend matching lines with your marker Step 2: Now with a regex search for any lines that match something like: ^[^###]+.*{.*} (i.e. anything with braces and the line not beginning with markers) and put in your returns Step 3: remove the markers

Categories : PHP

Single quotes, double quotes and passwords containing $ in Windows and Unix
You can dump from within a pdo PHP script : <?php $dumpSettings = array( 'include-tables' => array('table1', 'table2'), 'exclude-tables' => array('table3', 'table4'), 'compress' => CompressMethod::GZIP, /* CompressMethod::[GZIP, BZIP2, NONE] */ 'no-data' => false, /* http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_no-data */ 'add-drop-table' => false, /* http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_add-drop-table */ 'single-transaction' => true, /* http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_single-transaction */ 'lock-tables' => false, /* http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_lock-tables */ 'add-l

Categories : Windows

Best Way to escaping single quotes and double quotes in a string
you should use fn:escapeXml() because It escapes quotes and also other characters that could be interpreted as XML markup. . It also helps in prevention of XSS attack in JSP.

Categories : String

PHP Replace attribute single quotes with double quotes
I realized that PHP's DOMDocument class does this automatically... libxml_use_internal_errors(true); //use this to prevent warning messages from displaying because of the bad HTML $html = new DOMDocument();//'1.0','UTF-8' $html->xmlStandalone = false; $html->loadHTML($b); $b = $html->saveXML();

Categories : PHP

Heredocs, variables and single quotes in BASH and MySQL
Scrap that. My fault - missed the first field in the database. The single quotes work as they should with heredocs.. (i.e. '$VARIABLE' prints 'myvariable' just like $VARIABLE prints myvariable).

Categories : Mysql

PHP MySql double quotes than single quotes
double quotes signify that it's a string and the single quotes are part of a string. inside double quotes variables are evaluated so the string will contain the value of the variable 'vValue' not '$v'

Categories : PHP

php - the single quotes mixture with the double quotes use
Possibly just an error in the question, but this line has 2 semicolons: $query .= "WHERE id='" . $subject_id ."' ";; And if you skip the concatenation, this should work $query .= "WHERE id='$subject_id' "; In PHP, inside double quotes, single quotes are literal and variables are expanded. The other way you wrote it should work too, but it's more code than needed.

Categories : PHP

Bash: String variable that includes literal single quotes
Passing the password via command line is considered insecure as other users could see the password in plain text either using ps afx or the /proc file system. I've recently wrote a blog post regarding this topic. However, to make the command just working it needs double quotes " around $MYPASS to prevent bash from interpreting the space-sepearated password as multiple args: MYPASS="foo bar password" mysql -u backupuser -p"$MYPASS" -e ... But I would highly recommend a solution like the following, which uses expect to pass the password to mysqldump: #!/bin/bash # mysql credentials and connection data db_host="localhost" db_name="testdb" db_user="jon" db_pass="secret" # I'm using a here-document to pass commands to expect. # (the commands could be stored in a file as well) expect &l

Categories : Bash

How do I put single quotes inside of other single quotes?
You can surround them with different quotes in HTML (some of your HTML quotes were unbalanced). In PHP you'll have to escape the inner quotes: echo "<a href="#" onclick="popup('popUpDiv')"><img src='$pic'></a>";

Categories : PHP

Submitting NULL to database - single quotes issue?
You should set your table default to null, but to actually fix this you'll have to switch your quotes around, pHP evaluates any var between " and not so now it set an empty value and not literally null. THe best solution is this though if(empty($post['gallery']))$post['gallery'] = "NULL"; then it actually puts in the NULL value mysql needs

Categories : PHP

Double Quotes in Single Quotes
Escape the quotes in html using &quot; <video id="video1" class="video-js vjs-default-skin" width="640" height="480" data-setup='{ &quot;controls&quot;:true,&quot;autoplay&quot;:false,&quot;preload&quot;: &quot;auto&quot;}'>

Categories : HTML

SQl Output to CSV WITHOUT single Quotes
See doc QUOTE clause The QUOTE clause is for the TEXT output format only. The quote string is placed around string values. The default is a single quote ('). If ALL is specified in the QUOTE clause, the quote string is placed around all values, not just around strings. To suppress quoting, specify empty single quotes. For example, QUOTE ''. So it seems that you should do Output to 'C:SamplePacks.CSV' QUOTE ''

Categories : SQL

Single/double quotes ksh
The "$PWD" resolves immediately. So you're essentially setting PS1 to a fixed value (the value of PWD at the time it's set). When you set to '$PWD', it does not resolve immediately, so it resolves when used, and changes when you change directories. Thus the double quotes are expanding (to a fixed string) as expected, while single quotes are not.

Categories : Unix

PHP implode not working with single quotes?
This means $data has 1 item, because implode works just fine this way. var_dump($data); Please run the dump. Maybe you have wrong delimiter, so $data has one single element.

Categories : PHP

Bash: Execute command with spaces in quotes using backticks
Well, let set -x help us to see what is actually going on. + print_and_run_command 'date +%S' Second + COMMAND='date +%S' + DESCRIPTION=Second ++ date +%S + OUTPUT=13 + printf '%-30s %-30s %s ' 'date +%S' 13 Second date +%S 13 Second + 'print_and_run_command date +%H' Hour ./oh.sh: line 13: print_and_run_command date +%H: command not found + print_and_run_command 'date +%Y-%m-%dT%H:%M:%S%z' 'T-separated rfc 3339 / ISO 8601' + COMMAND='date +%Y-%m-%dT%H:%M:%S%z' + DESCRIPTION='T-separated rfc 3339 / ISO 8601' ++ date +%Y-%m-%dT%H:%M:%S%z + OUTPUT=2013-07-31T01:24:13+0400 + printf '%-30s %-30s %s ' 'date +%Y-%m-%dT%H:%M:%S%z' 2013-07-31T01:24:13+0400 'T-separated rfc 3339 / ISO 8601' date +%Y-%m-%dT%H:%M:%S%z 2013-07-31T01:24:13+0400

Categories : Bash

Escaping single quotes for Java MessageFormat
Use the escapeEcmaScript method from Apache Commons Lang package. See Stack Overflow questions: Escaping single quotes for Java MessageFormat How to escape apostrophe or quotes on a JSP (used by JavaScript)

Categories : Java

save XML file with single quotes with JDOM
Technically, yes.... but.... There is nothing semantically different between single and double quotes.... (the resulting document from JDOM is just as valid).... Is there a really good reason why you need to do this? If there is, I would be interested to know, and perhaps introduce it as a 'native' feature of JDOM.... But, you can change the format of it with (only) a little bit of work - 15 lines of code or so... The JDOM2 API in theory makes this a fair amount easier. You can create your own XMLOutputProcessor, using a subclass of the AbstractXMLOutputProcessor and override the printAttribute() method... for example (getting rid of some code paths that your are not likely to need (like non-escaped output): private static final XMLOutputProcessor CUSTOMATTRIBUTEQUOTES = new AbstractXMLO

Categories : Java

Excel Escaping Single and double quotes
I find the easiest is to define a variable that contains just the double quote - then use it like any other string. Makes the code much more readable. Example: Dim dq As String, sq as string dq = Chr(34) ' double quote as a variable sq = Chr(39) ' apostrophe or single quote as variable Dim sourceString As String sourceString = "hello" msgbox sq + sourceString + "! " + dq + "you" + dq + sq With these two variables you can create any string you want - after that, replacing what you want with something else (that might contain a crazy sequence of "'"'"'"("!"'") for all I care) becomes trivial. Some helpful rules can be found in this article

Categories : Excel

Javascript regex for single, double and no quotes
"width='200', width="200", width=200".replace(/(width=)(?:".*?"|'.*?'|S*)/g, '$1"555"') // => width="555", width="555", width="555" But yeah, this is not a job for regexp.

Categories : Javascript

How can I escape single quotes from get method in Javascript?
You should use php's urldecode on the value. Docs found at http://php.net/manual/en/function.urldecode.php Let me know if that's what you're looking for :)

Categories : PHP

Showing check box label with single quotes
I copied this code: <input type="checkbox" name="<%= contact.contact_value %>" id="<%= contact.contact_value %>" class="custom" /> <label for="<%= contact.contact_value %>"><br/></label> and added it to an existing app view, adding a variable, removing contact. and removing all of the double quotes to make a test: <% contact_value = "'gh'g@ff.bn'" %> <input type="checkbox" name=<%= contact_value %> id=<%= contact_value %> class="custom" /> <label for=<%= contact_value %>><br/><%= contact_value %></label> I get: without any errors. Give it a try without any quotes around the <%= contact.contact_value %> in the view code.

Categories : Ruby

Is it necessary to explicitly specify single quotes in a DML statement that uses String.Format()?
If all of the values are of numerical types such as int, decimal, bigint, etc. then you don't need to enclose them in single quotes. This code works (I just tested it) dSQL = string.Format( "INSERT INTO inventory ( id, pksize, Description, supplier_id, UnitCost, UnitList," + " Qty, UPC, dept, subdept, upc_pack_size, supplier_item, bqu_id)" + " VALUES ({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12})", id, pksize, desc, supplierID, cost, list, qty, UPC, dept, subdept, UPCpkSize, supplierItem, redemption); You were missing the starting and closing braces in your code.

Categories : C#

jquery function works after single space in quotes
First question The jQuery's argument is a CSS selector. The space means that you are selecting a child of div:not([id=header]); "div:not([id=header]) div#foo" is not the same as "div:not([id=header])div#foo" Second question: The "hierarchy" of quotes doesn't matter, "text'foo'dd" is OK, just as 'text"foo"dd'. It's up to your taste, but usually using single quotes outside is more practical, since you can have the double ones, used most of the time, in the string.

Categories : Javascript

Removing single quotes from comparison in select statement
Take a look at: http://www.artfulsoftware.com/infotree/queries.php#552 This will give you the distance between two strings. I.e. you can check whether levensthein distance is less than 3, which means, less than 3 operations are required to be equal.

Categories : Mysql

append values with both single and double quotes to textbox
This is because you are concatenating strings, which doesn't take escaping of special characters into account. You should instead set the value with .val so that the value is escaped properly. Also, the regex is unnecessary. $(document).ready(function(){ var test= "this is vicky"s "s 's 's "s "S"; alert(test); var input = $("<input style='width:700px;' id='testbox'></input>").val(test); $("#test").html("hey this is ").append(input); }); See updated test case on jsFiddle

Categories : Javascript

PHP to output single and double quotes as a value for an input element
Try using htmlspecialchars. This will escape the " in yout title. value="'.htmlspecialchars($title).'">

Categories : PHP

Single and double quotes in textfield, how to make them visible?
printf('<input type="text" name="1" id="1" value="%s">', htmlspecialchars($string)); HTML escape the data. All data you're outputting into HTML, in fact. See The Great Escapism (Or: What You Need To Know To Work With Text Within Text).

Categories : PHP

Rails email double escaping single quotes
Turns out it was a change one of the other developers had made. They'd added sanitisation to the input so it was being escaped before being stored, and then rails was escaping it when displaying so it was being double escaped. Sorted now :)

Categories : Ruby On Rails

how to force jquery attr() to add the attribute with single quotes
Replace the double quotes with HTML entities: var value = '{"video1":"http://www.youtube.com/watch?v=KdxEAt91D7k&list=TLhaPoOja-0f4","video2":"http://www.youtube.com/watch?v=dVlaZfLlWQc&list=TLalXwg9bTOmo"}'; # Naive approach: value = value.replace('&', '&amp;').replace('"', '&quot;'); # Using jQuery: var $tmp = jQuery('<div></div>'); value = $tmp.text(value).html(); // Then store it as normal

Categories : Javascript

Why do the most languages employ double quotes not single for String Literals?
In some languages double quotes represent strings, and single quotes represent characters. In other languages double quotes can interpolate variables while single quotes can't. JavaScript is not the only one that allows single quotes for strings, PHP does, and so does Ruby, and many others, but in JavaScript there's no difference at all of using one or the other.

Categories : Javascript

Replacing the single quotes for columns in select statement in SQL Server
You will need to use dynamic SQL to achieve this, for example: CREATE TABLE Table1 ( ID INT ,Name VARCHAR(255) ,ADDRESS VARCHAR(255) ) INSERT Table1 VALUES ('1','Joe Bloggs','Address 1') INSERT Table1 VALUES ('2','Jane Doe','Address 2') DECLARE @ColName VARCHAR(255) = 'ID' DECLARE @SQL VARCHAR(MAX) SET @SQL = 'SELECT '+@ColName+','+''''+@ColName+''' FROM TABLE1' EXEC (@SQL) In the first column that is returned, is the SQL you want to be able to execute, however in the 2nd column in my query, is what you're doing at the moment. As far as SQL is concerned, your variable is simply storing a value. It does not know you are referring to a column name which is why it simply returns the value.

Categories : Sql Server

Single-Double quotes error in Full Text Search
You have an extra embedded double quote: CONTAINS(PositionDesired,'"*"JAVA*"') ----------------------------^ This effectively terminates the string early, and SQL Server doesn't understand what that extra stuff is. Should be (I think, not a full-text guru): CONTAINS(PositionDesired,'"*JAVA*"') However, I think that will eliminate the error, but not return the results you are after, since punctuation is ignored. You may have to use a combination of CONTAINS and LIKE, e.g.: CONTAINS(PositionDesired,'JAVA') AND PositionDesired LIKE '%"JAVA"%' Or for the new requirement you've added: CONTAINS(PositionDesired,'JAVA PHP') AND PositionDesired LIKE '%"JAVA"PHP%"' In the LIKE clause you don't have to worry about escaping or doubling-up the double quote, because it isn't a string

Categories : Sql Server

How to escape single quotes in reStructuredText when converting to HTML using Sphinx
Well, not sure which parts you think are mis-spaced, but the quotes on the far left don't have extra spaces in the sceenshot, that's just how single quotes render in monospaced fonts. As for the right column, why not double-backtick-enclose the whole cell? That also kills the "smart" quotes, which, I think, is what you're going for. ``ss '' SSS" -> "45 ' 876"`` # could instead be this, if these were the spurious spaces ``ss''SSS -> "45'876"`` You can't otherwise get rid of the spacing around double-backticked spans - as far as the parser is concerned, those make up a "word", and it's up to the writer to handle the whitespace between words. Where you need to control whitespace, it's not "prose", it's a literal section, and the whole whitespace-significant text should be double-back

Categories : Python

Javascript regex, getting error when removing all single quotes except for those that precede an s
(?<![a-z]) is the problem, because lookbehind doesn't exist in javascript. If you want make some test for regex in javascript, use an online tool for javascript like regexpal. I don't know what you are trying to do but you can try this code: return str.replace(/%2[37]|(^|[^a-z])'|'(?!s)|--|#/gi, "$1-restricted-"); I have replaced the negative lookbehind (?<![a-z]) (ie: not preceded by a letter) by a capturing group (^|[^a-z]) (ie: begining of the string OR a character that is not a letter). Since it is not a simple check like a lookaround but a match, the replace will delete this "non-letter", then I put a reference in the replacement pattern to this first capturing group ($1) to replace it by itself.

Categories : Javascript

Why does this snippet with a shebang #!/bin/sh and exec python inside 4 single quotes work?
Python supports triple-quoted strings: '''something''' Shell supports only single-quoted strings: 'something' By using four quotes, sh sees that as 2 empty strings, but Python sees the first three as the start of a triple-quoted string, and includes the fourth as part of the string value. The rest of the line is then interpreted as a command by sh, but as part of a string by Python. The # then forms a comment as far as sh is concerned, but it is still a string to Python, closing it off with a closing triple-quote. So, to summarize: sh sees: empty string ('') - empty string ('') - command (exec python -u -- "$0" ${1+"$@"}) - comment (# ''') Python sees: triple-quoted string literal (containing the characters 'exec python -u -- "$0" ${1+"$@"} #) So sh executes that command, repl

Categories : Python

how to select numbers that is not between double/single quotes with regular expression in javascript
I would do that : var numbers = str.split('"').filter(function(_,i){ return !(i%2) }).join('') .split("'").filter(function(_,i){ return !(i%2) }).join('') .match(/d+/g); The idea is to start by removing what is between quotes and then applying a regular expression. Demonstration (open the console) But, like any time HTML and regexes are mixed, you'll find cases where it doesn't work. So, if your use case isn't strictly controlled, you'd better parse, for example by applying a regex to element.texContent||element.innerText.

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.