473,387 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Setting Variable to DB conents which contains quotes

FP
I can get the contents of the my database comments field using PHP.
The comments field may include single or double quotes or other strange
characters.
How do I compensate for these problem characters when I try to set a
JavaScript variable? eg.

<SCRIPT LANGUAGE="JavaScript">
MyComments = "<? PHP result here?>"
</script>

Jul 4 '06 #1
1 1149
Rik
FP wrote:
I can get the contents of the my database comments field using PHP.
The comments field may include single or double quotes or other
strange characters.
How do I compensate for these problem characters when I try to set a
JavaScript variable? eg.

<SCRIPT LANGUAGE="JavaScript">
MyComments = "<? PHP result here?>"
</script>
Don't multipost.
Answered in comp.lang.php

Grtz,
--
Rik Wasmus
Jul 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Boefje | last post by:
The variable contains: delete from divisies where divisieid='1c' After posting it contains: delete from divisies where divisieid= So the part '1c' is magically lost! How is that possible? This...
2
by: Bradford | last post by:
Question for the masses... Lets say I have variable with the following contents "aaaa bbbb ccccc dddd". The format is not specific and the space delimiter could be changed to any other. How...
8
by: Jerry | last post by:
I am a MySQL and PHP newbie. I am having trouble getting the $w variable in my code below passed to mysql. When I use the value of $w directly in the Where clause, the correct rows are returned....
14
by: Matt | last post by:
I need to add the following variable into an SQL statement and not sure how to do it. strGCID needs to be inserted into the following statement: SQL = "SELECT tblContacts.* FROM tblContacts...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
6
by: Dan | last post by:
Excuse me if i'm being a bit thick here, but is it possible to reference a server side variable within an embedded js source file. For example, my test.js file contains alert('<%=tmpVar%>'); ...
1
by: andersond | last post by:
I have a web application that relies on CGI pages to manipulate data captured and displayed in a series of html pages. On one of those pages I display comparative quotes and use javascript to...
2
by: DanWeaver | last post by:
I am assigning a profile variable based on the conents of a text box when a button is pressed- this is then used as a search term to populate a list box- all controls are in same ajax update panel-...
6
by: j.woodcock | last post by:
is there a way of having a file that's name is a variable (eg dependant on the user name) act like a include. i know that you cant define the file for an include asp tag using a variable and that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.