Solved

update error

Posted on 2013-06-25
6
197 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 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39274721
0
 
LVL 110

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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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 110

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP Web Development 6 32
Compiling PHP with Curl plus protocols 8 26
.CSS HTML Help 3 32
How do i use the await event in php echo 5 19
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

696 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