370 questions
0
votes
0
answers
184
views
Json.dumps alternative in Redshift
I have strings like
Origi\"nal
and
Origi"nal
. I want to convert them to raw string and then to a Json String and write to a table in Redshift.
Example output of "select col from ...
5
votes
2
answers
4k
views
MySQL: What does means "escape '!'" on query
Editing someone else's code found this query:
SELECT c.name AS category_name,
p.id,
p.name,
p.description,
p.price,
p.category_id,
p.created
FROM products ...
2
votes
1
answer
2k
views
How to detect if a string contains PHP code? PHP
I am keeping record of every request made to my website. I am very aware of the security measurements that need to be taken before executing any MySQL query that contains data coming from query ...
0
votes
1
answer
503
views
$mysqli->escape_string - can it be used without specifying exact field name
I have code that generalizes building the SQL string to insert a record into a table by (1) setting the 'name' of the form element to be the same as the table column to which it corresponds, and (2) ...
0
votes
1
answer
625
views
insert blob not working (mysql_real_escape_string)
I am trying to copy image blobs from one table to another, and it is not working, since the mysql_real_escape_string () is no longer available. The special characters in the blob are blocking the ...
0
votes
1
answer
1k
views
mysqli_real_escape_string() for entire $_POST array in php [duplicate]
I have $_POST with 20 keys. I want to apply mysqli_real_escape_string() for the entire $_POST array. So, should I apply mysqli_real_escape_string() to all 20 keys separately? Or is there any loop or ...
0
votes
2
answers
4k
views
mysql_real_escape_string() function not working in wordpress WP_Query?
We have tried this way. But it is not working. please any one tell alternative method in wordpress
$wpdb->query("UPDATE ".$wpdb->prefix."recommend_bets SET `title`='".mysqli_real_escape_string($...
0
votes
2
answers
1k
views
Call to a member function real_escape_string() on array in
I am struggling with something strange. I am running a mysqli::real_escape_string on a function to prepare an SQL statement. I am taking data from one database and developing a query to insert it ...
0
votes
0
answers
119
views
from real_escape_string appears as text on browser
From real_escape_string code is showing as text not running on browser, even dreamweaver showing no error please help
if any alternative then please tell me.
trying to create a subscribe php form with ...
3
votes
1
answer
2k
views
Sanitizing URLs being inserted into a WordPress MySQL database
I am writing a plugin for Wordpress, where I have my own custom table to store the relevant data being pulled from a remote API. One of the elements I need to store is a URL, which is a TEXT field ...
1
vote
0
answers
21
views
Escape again after value manipulation in PHP [duplicate]
Let's say i have this code:
$value = mysqli_real_escape_string($con, $_POST['value']);
$value = strip_tags($value, '<br>');
for example with this value: $_POST['value'] = "<div>how<br/&...
0
votes
2
answers
199
views
Trying to make a work around for the mysqli_real_escape_string
So currently I have my code in procedural format so inorder to prevent myself from adding the "link" in the mysqli_real_escape_string function I've made a method that looks like this:
// Used to ...
0
votes
1
answer
166
views
MySQL real escape - Own escape - o to ö?
I want to escape all my strings I want to insert in my database. But my problem is, because I have more than 10.000 strings to check, the database queries would be too much...
So I use this escape ...
1
vote
1
answer
2k
views
Escape Special characters in Cakephp find query
Using
Cakephp version: 2.5.1
I have some trouble finding a solution for dealing special characters in Cakephp find queries.
If you could please point me in right direction, I would really ...
10
votes
2
answers
61k
views
Escaping a string with quotes in Laravel
I would like to insert the content of an excel file into my database.
I simply use a raw query to achieve this.
The controller function
public function uploadExcel()
{
$filename = Input::file('...
-4
votes
4
answers
8k
views
mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in
.../general.php on line 10
Hello, this is my error, but only occurs when I upload my web to a host, in the localhost run well.
the (return mysqli_real_esc..)line is the "line 10".
$conncet = ...
2
votes
2
answers
519
views
why does mysqli_escape_string require a database connection?
why can't I used the mysqli_escape_string function without having a database connection?
1
vote
0
answers
494
views
Cleaning the post array?
I am very new to PHP and I am trying to add in precautions to my web form to avoid misuse, these inputs from the user are being stored to a database. I keep getting errors when trying to pass through ...
0
votes
1
answer
603
views
Is it necessary to use mysqli_real_escape_string with data from <input type=number> inputs? [duplicate]
Just as the title states. Is it a standard procedure/practice to escape number inputs?
I know text fields should be escaped, but i'm wondering if I need to escape numbers.
0
votes
2
answers
551
views
Where should I place mysql_real_escape_string? [closed]
What's the best way to use mysql_real_escape_string, is it at the beginning like this:
$email = mysql_real_escape_string($_POST['email']);
$qemail = mysql_query ("SELECT email FROM ppl WHERE email='$...
0
votes
1
answer
841
views
php prepared statement inserting with trim or date() etc. php strict standards error
Hopefully a very easy question, but I haven't been able to find the answer. I'm learning to use prepared statements rather than mysqli_escape. I have the code:
$stmt = $dbc->prepare("SELECT ...
0
votes
2
answers
103
views
mySql real escape string returning blank
I have a php program that uses cookies to store data across pages and redirects. I want to use mysql_real_escape_string() before sending them to my server, so far my code looks like this
$...
2
votes
2
answers
5k
views
mysql_real_escape_string not work in php 5.4.44
I am runing PHP Version 5.4.44 on my website and try to us mysql_real_escape_string but it does not give me any thing .mysql_real_escape_string works just fine in localhost on my computer.Example ...
0
votes
0
answers
63
views
string replace in PHP is not working [duplicate]
I need to insert (for example: "ABC") to my wamp db. I'm using str_replace method for this. Code is as shown below:
$currAddr=str_replace(array("'","\"", """),"'",htmlspecialchars($...
0
votes
1
answer
75
views
mysqli_real_string_escape failing with GET
I have a static database connection established in a file which I include as
include_once 'database.inc.php';
named $mysqli.
When I pass a parameter $tbname from a form using $tbname = $_GET['tbname'...