Error Unknown column in field list error on MySQL Update query

0 votes

I keep getting MySQL error #1054, when trying to perform this update query:

UPDATE MASTER_USER_PROFILE, TRAN_USER_BRANCH
SET MASTER_USER_PROFILE.fellow=`y`
WHERE MASTER_USER_PROFILE.USER_ID = TRAN_USER_BRANCH.USER_ID
AND TRAN_USER_BRANCH.BRANCH_ID = 17

It's probably some syntax error, but I've tried using an inner join instead and other alterations, but I keep getting the same message:

Unknown column 'y' in 'field list' 
Aug 20, 2020 in PHP by kartik
• 37,510 points
13,174 views

1 answer to this question.

+1 vote

Hello @kartik,

Enclose any string to be passed to the mysql server inside single quotes; e.g.:

$name = "my name"
$query = " INSERT INTO mytable VALUES ( 1 , '$name') "

Note that although the query is enclosed between double quotes, you must enclose any string in single quotes.

Hope it helps!!
Thank you!!

answered Aug 20, 2020 by Niroj
• 82,880 points

Related Questions In PHP

0 votes
1 answer

Error:MySQL Update Inner Join tables query

Hello @kartik, Try this: UPDATE business AS b INNER JOIN ...READ MORE

answered Aug 19, 2020 in PHP by Niroj
• 82,880 points
1,829 views
0 votes
1 answer

Error: Maximum execution time of 60 seconds exceeded in C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140

Hello @kartik, Go to: xampp\phpMyAdmin\libraries\config.default.php Look for : $cfg['ExecTimeLimit'] = 600; You ...READ MORE

answered Sep 1, 2020 in PHP by Niroj
• 82,880 points
13,708 views
0 votes
1 answer

Error:PHP Warning: POST Content-Length of 8978294 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

Hello @kartik, 8388608 bytes is 8M, the default ...READ MORE

answered Sep 17, 2020 in PHP by Niroj
• 82,880 points
27,247 views
0 votes
1 answer

Error:preg_match() [function.preg-match]: Unknown modifier '+' in raptr.php on line 14

Hello, Try this code: preg_match('/[a-zA-Z]+<\/a>.$/', $lastgame, $match); print_r($match); Using / as a delimiter ...READ MORE

answered Nov 23, 2020 in PHP by Niroj
• 82,880 points
1,967 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
21,708 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
2,630 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
2,486 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
41,156 views
0 votes
1 answer

MySQL - UPDATE multiple rows with different values in one query

Hello @kartik You can use a CASE statement to handle ...READ MORE

answered Jun 1, 2020 in PHP by Niroj
• 82,880 points
32,962 views
0 votes
1 answer

Invalid argument supplied for foreach() on line 25. Error in my php and mysql

Hello @viven , This should be a simple fix ...READ MORE

answered Aug 4, 2020 in PHP by Niroj
• 82,880 points
3,809 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP