We help IT Professionals succeed at work.
Get Started

MySQL Update Statement Syntax / PDO

rowdyj81 asked
Last Modified: 2021-04-21
I recently added PDO support to our server.  Not surprisingly, some php scripts that worked before this update are now glitching up.  I have a very simple script that updates a field in a database when a form is submitted.  This SQL statement works when I execute it in phpMyAdmin.  When the form is submitted, it does not work; however, I don't get an error message. Everything in the targeted field in the database gets erased.  Nothing gets updated.  

Here is my code.  Anyone have an idea what's going on?  I know this has to be something stupid that I'm missing.
$sqlone = "UPDATE specials SET content = '$content' WHERE label = 'specials'";
$queryone = mysql_query("$sqlone", $con);

Open in new window

Watch Question
Sr. System Analyst
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE