?
Solved

update error

Posted on 2013-06-25
6
Medium Priority
?
199 Views
Last Modified: 2013-06-25
Hi,

I get an error with update and I am not sure how to fix it. The data gets passed from html and the cols in mysql exist.

$query = "UPDATE tbmod1 VALUES set    q1='$q1', q2='$q2', q3='$q3', q4='$q4', q5='$q5', q6='$q6', q7='$q7', q8='$q8', q9='$q9', q10='$q10 ',q11='$q11',q12='$q12' where user='a'";

$result = mysql_query($query) or die(mysql_error());

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES set q1='enter here', q2='enter here', q3='enter here', q4='asd', q5='k' at line 1
0
Comment
Question by:jagguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 39274721
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39274725
Also, you want to get off of MySQL.  PHP is removing it.  This article explains why and what you must do to keep your scripts running.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_11177-PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html
0
 
LVL 22

Expert Comment

by:Om Prakash
ID: 39274727
Try
$query = "UPDATE tbmod1 set    q1='$q1', q2='$q2', q3='$q3', q4='$q4', q5='$q5', q6='$q6', q7='$q7', q8='$q8', q9='$q9', q10='$q10 ',q11='$q11',q12='$q12' where user='a'";
0
WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

 
LVL 15

Expert Comment

by:Jagadishwor Dulal
ID: 39274741
The problem is VALUES Remove Values from your query:
$query = "UPDATE tbmod1 set    q1='$q1', q2='$q2', q3='$q3', q4='$q4', q5='$q5', q6='$q6', q7='$q7', q8='$q8', q9='$q9', q10='$q10 ',q11='$q11',q12='$q12' where user='a'"; 

Open in new window

0
 

Author Comment

by:jagguy
ID: 39274745
ok it works thanks.

What I might do is use mysql and when php5.5 comes in , change what I have then. I dont use mysql/php enough to really worry about the latest method .
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39274782
Thanks for the points.  

I think you may be missing the importance of PHP's direction with the MySQL extension.  It's not about whether your PHP/MySQL scripts will keep running (they will run for a while and will break eventually).  It's about object-oriented programming, security, and object reuse.  As PHP matures, so must the programming techniques of PHP users.  As PHP moves forward in time, support is removed for older releases.  Today, PHP 5.4 is current and PHP 5.2 is no longer supported, not even for security exploits.  So if someone finds a way to hack a PHP 5.2 site, the only recourse the site publisher has is to upgrade.  It's a terrible thing to find yourself doing an emergency upgrade.  That's why professionals take the longer view and stay on top of advancements in technology and technique.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question