3.0.5

phpsql code

why have the addslashes($value) being used in the above code i.e. to retrieve value from database
Eric Ilavia
September 4,
That's probably a mistake. In javascript it is necessary to escape double quote (") and newline chars as \" and \n, however addslashes() does not handle newline, so it should be replaced with something else (regexp?)
Alex (ActiveWidgets)
September 4,
Thank-You for ur reply Alex but i want to know why addslashes() is used in the above code i.e. what is the importance of addslashes in the above code and why is double quotes (") being used before and after addslashes
Eric Ilavia
September 6,
This code creates text output in JSON format (javascript array) which should look like this -

[
["cell1-1", "cell2-1", "cell3-1"],
["cell1-2", "cell2-2", "cell3-2"]
]

You should enclose strings in quotes or double quotes.
Alex (ActiveWidgets)
September 6,
Thank-You Alex for the reply
Eric Ilavia
September 7,

This topic is archived.

See also:


Back to support forum