Click here to Skip to main content
14,425,800 members

Web Development

 
PinnedHow to get an answer to your question Pin
Chris Maunder4-Sep-10 3:25
cofounderChris Maunder4-Sep-10 3:25 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 23:40
cofounderChris Maunder12-Jul-09 23:40 
QuestionArchitectural Guidance Pin
cjb11019-Jan-20 22:30
Membercjb11019-Jan-20 22:30 
QuestionCalling Web API From Xamarin Forms Pin
Kevin Marois16-Jan-20 10:50
professionalKevin Marois16-Jan-20 10:50 
AnswerRe: Calling Web API From Xamarin Forms Pin
Richard Deeming17-Jan-20 1:48
communityengineerRichard Deeming17-Jan-20 1:48 
QuestionHow to handle api call in Angularjs using webservice http method Pin
praveena Tatikonda15-Jan-20 0:46
Memberpraveena Tatikonda15-Jan-20 0:46 
AnswerRe: How to handle api call in Angularjs using webservice http method Pin
Richard MacCutchan15-Jan-20 1:01
communityengineerRichard MacCutchan15-Jan-20 1:01 
QuestionPHP MVC :: Which file is responsible for collecting user input? Pin
BlowMagnum14-Jan-20 11:28
MemberBlowMagnum14-Jan-20 11:28 
Questionwhich one is best AngularJS or ReactJS? Pin
Member 147054432-Jan-20 8:27
MemberMember 147054432-Jan-20 8:27 
AnswerRe: which one is best AngularJS or ReactJS? Pin
Richard MacCutchan2-Jan-20 23:02
communityengineerRichard MacCutchan2-Jan-20 23:02 
AnswerRe: which one is best AngularJS or ReactJS? Pin
Nathan Minier6-Jan-20 2:10
professionalNathan Minier6-Jan-20 2:10 
AnswerMessage Closed Pin
9-Jan-20 23:14
MemberCSSChopper9-Jan-20 23:14 
AnswerRe: which one is best AngularJS or ReactJS? Pin
CSSChopper10-Jan-20 1:23
MemberCSSChopper10-Jan-20 1:23 
QuestionSQLSTATE[42S22]: Column not found: 1054 Unknown column in 'field list' Pin
BlowMagnum25-Dec-19 8:40
MemberBlowMagnum25-Dec-19 8:40 
So I am currently trying to write an PHP function which updates fields within a table (mysqli database):

The code that I currently have in my PHP code function is:

public function insertValue($id, $attribute, $value){
    try {
        $stmt = $this->connect()->query("UPDATE attributes SET ".$attribute." = ".$value. " WHERE id = ".$id);
    } catch (Exception $e) {
        return $e->getMessage();
    }


Where the parameters are being passed from another .php file:

if (isset($_POST['box2__submit'])) {
    $id = $_POST['box2__userid-input'];
    $attribute = $_POST['box2__attribute-input'];
    $value = $_POST['box2__value-input'];
    $DB = new db_class();
   echo $DB->insertValue($id, $attribute, $value);


Now the problem is that everything works fine untill I pass a value that is letters for example passing - "Hello" with $value throws an error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Hello' in 'field list'


However if I pass values that are numerical, for example - 1337, it works just fine. I have no idea what's wrong and how can I fix this.

Help!
AnswerRe: SQLSTATE[42S22]: Column not found: 1054 Unknown column in 'field list' Pin
Graham Breach25-Dec-19 21:29
MemberGraham Breach25-Dec-19 21:29 
GeneralRe: SQLSTATE[42S22]: Column not found: 1054 Unknown column in 'field list' Pin
BlowMagnum26-Dec-19 8:32
MemberBlowMagnum26-Dec-19 8:32 
QuestionbNorton Safeweb - anyone else come across this? Pin
DerekT-P18-Dec-19 8:46
professionalDerekT-P18-Dec-19 8:46 
AnswerRe: Norton Safeweb - anyone else come across this? Pin
phil.o26-Dec-19 0:04
mvephil.o26-Dec-19 0:04 
QuestionWhat is considered "Reusable CSS?" Pin
BlowMagnum18-Dec-19 3:41
MemberBlowMagnum18-Dec-19 3:41 
AnswerRe: What is considered "Reusable CSS?" Pin
BlowMagnum23-Dec-19 3:13
MemberBlowMagnum23-Dec-19 3:13 
QuestionWhen to use position on an element in CSS? Pin
BlowMagnum17-Dec-19 6:56
MemberBlowMagnum17-Dec-19 6:56 
AnswerRe: When to use position on an element in CSS? Pin
Richard Deeming17-Dec-19 7:14
communityengineerRichard Deeming17-Dec-19 7:14 
QuestionWeb Services Pin
milo-xml16-Dec-19 7:02
professionalmilo-xml16-Dec-19 7:02 
AnswerRe: Web Services Pin
MadMyche18-Dec-19 9:12
mveMadMyche18-Dec-19 9:12 
GeneralRe: Web Services Pin
milo-xml18-Dec-19 9:25
professionalmilo-xml18-Dec-19 9:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.