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 6833703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:00:41+00:00 2026-05-26T23:00:41+00:00

I have used function substr in my sql query: UPDATE staff SET dept_id=’.$department.’, SUBSTR(auth,

  • 0

I have used function substr in my sql query:

UPDATE staff 
   SET dept_id='".$department."', 
       SUBSTR(auth, 0, 1) = 'l' 
 WHERE staffid='".$name."'

…but query fails:

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 'SUBSTR(auth, 0, 1)='l' WHERE staffid='55000010'' at line 1

I wish to replace first 0th charater upto length 1 of auth column to value ‘l’

  • 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-05-26T23:00:41+00:00Added an answer on May 26, 2026 at 11:00 pm

    I looks like you are attempting to replace the first character of the auth field with a l – although it is not entirely clear from your post if that is the intention, or just to prefix it.

    UPDATE staff set dept_id='".$department."', auth=concat('l',SUBSTR(auth, 2))
    WHERE staffid='".$name."' 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update 2 : So I never have used the debug function in firebug, but
I have used sendinput() function and windows keyboard hooks to develop a custom keyboard
I have used the crypt function in c to encrypt the given string. I
I have used Javascript onlaod like this: function check() { var pic = new
I have a function that I have used a bunch of times in various
I would like to have the choice in a variable_load function (as used to
I have 2 radio buttons and I used mootool while loading as window.addEvent('domready', function()
i have a function (below) which is used in my mysql abstraction class and
To get the removable drives i have used GetDriveType ( ) function Is it
I have used the explode function in PHP to break up a string into

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.