-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello,
I am submitting a form to my mySql database using PHP.
I am sending the form data through the
mysql_real_escape_string($content);
function.
When the entry shows up in my database (checking in myPhpAdmin) all of my double quotes and single quotes are escaped.
I'm fairly certain this…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Code
mysql_query("INSERT INTO Account(User,
Pw, email)
VALUES('mysql_real_escape_string($_POST[user])',
'$pw','mysql_real_escape_string($_POST[email])
) ") or die(mysql_error());
Error:
You have an error in your SQL syntax;
check the manual that corresponds to
your MySQL server…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
i'm trying to learn php/mysql.
inserting data into mysql works fine but inserting those with apostrophe is generating an error. i tried using mysql_real_escape_string, yet this doesn't work.
would appreciate any help.
<?php
include 'config.php';
echo "Connected <br />";
$auth =…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have the following code:
function dbPublish($status)
{
global $dbcon, $dbtable;
if(isset($_GET['itemId']))
{
$sqlQuery = 'UPDATE ' . $dbtable . ' SET active = ? WHERE id = ?';
$stmt = $dbcon->prepare($sqlQuery);
$stmt->bind_param('ii', $status, $_GET['itemId']);
$stmt->execute();
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a pretty large insert statement something like
INSERT INTO multimedia (filename, regex, flag) VALUES (('adsfavr.jpg', '<div id="title">', 0), (...), (...));
How do I prepare the query for MySQL.It's too long to do it manually. It includes double quotes so I can't use the php function…
>>> More