Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8520095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:26:22+00:00 2026-06-11T06:26:22+00:00

namekey values . . . . . . username to be updated #!/usr/bin/perl -w

  • 0

namekey values
. .
. .
. .
username to be updated

#!/usr/bin/perl -w
# Use the DBI module

use  strict;
use warnings;
use DBI;

# CONFIG VARIABLES
my $platform = "mysql";
my $database = "prod";
my $host     = "localhost";
my $username = "root";
my $password = "admin";

# DATA SOURCE NAME
my $dsn = "dbi:$platform:$database:$host";

# PERL DBI CONNECT
my $connect = DBI->connect($dsn, $username, $password);

# VARS for Examples
my $query;
my $query_handle;
my $id;
my $demo;

# Example 2 using do() UPDATE   

# SAMPLE VARIABLE AND VALUES TO PASS INTO SQL STATEMENT
$id   = "username";
$name = "Arty";

# do() THE UPDATE
$query        = "UPDATE jos_config SET values = '$name' WHERE namekey = $id;";
$query_handle = $connect->prepare($query);

# EXECUTE THE UPDATE
$query_handle = $connect->do($query);

print STDERR "ERROR: $DBI::errstr";
print STDERR "INFO: $query_handle rows updated";

undef $query;

error message:

DBD::mysql::db do failed: 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 = 'Arty' WHERE namekey = smtp_username' at line 1 at /home/arty/Documents/SmtpDbchange2.pl line 40.
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 = 'Arty' WHERE namekey = smtp_username' at line 1Use of uninitialized value $query_handle in concatenation (.) or string at /home/arty/Documents/SmtpDbchange2.pl line 43.

please assist

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:26:24+00:00Added an answer on June 11, 2026 at 6:26 am

    Your syntax error comes from the fact that “values” is a reserved word in SQL. You need to quote that token when it functions as an identifier:

    UPDATE jos_config SET `values` = ...
    

    Generally, MySQL shows you just where the syntax error is at the beginning of the query excerpt, as it did for you.

    Your next problem will be that you have not properly quoted the literal value you compare against namekey, and that literal value will look like an identifier rather than a string to MySQL. The solution here is to forget about interpolating variables and use parameterized queries:

    $connect->do('UPDATE jos_config SET `values`=? WHERE namekey=?', undef, $name, $id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two ListBoxes, both use Extended SelectionMode. The ItemsSource of the first is
When I use a strong name key file as indicated in the project properties,
I'm trying to use a global resource dictionary, but I'm getting an error when
How can I use the ON DUPLICATE UPDATE with a multiple value INSERT? INSERT
I want to get different values when I click different list items in my
My autocomplete data comes in as such {label:Apple iPhone 3G,values:293}.. ect.. when a user
In the visual studio project settings you can choose a strong name key file
The DataSource (of my repeater) is a Dictionary<string, IList<User>> I would like the repeater
I have set up a HashMap like so: Map<String, ArrayList<String>> theAccused = new HashMap<String,
Im using c# .net windows form application. I have created a database which has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.