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

  • Home
  • SEARCH
  • 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 8994505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:26:50+00:00 2026-06-15T23:26:50+00:00

I don’t get what’s wrong. This is the full error I get: Fuel\Core\Database_Exception [

  • 0

I don’t get what’s wrong. This is the full error I get:

Fuel\Core\Database_Exception [ 42000 ]: SQLSTATE[42000]: Syntax error or access violation:
1064 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 'to, from, message, checked) VALUES ('1', 
'freddy', 'bob', 'message', '1')' at line 1 with query: "INSERT INTO chatmes (id, to, from, 
message, checked) VALUES ('1', 'freddy', 'bob', 'message', '1')"

And this my PHP code which is supposedly giving me the error:

<?php

define('DOCROOT', __DIR__.DIRECTORY_SEPARATOR);                 
define('APPPATH', realpath('/var/www/vhosts/grubber.co.nz/httpdocs/fuel/app/').DIRECTORY_SEPARATOR);
define('PKGPATH', realpath('/var/www/vhosts/grubber.co.nz/httpdocs/fuel/packages/').DIRECTORY_SEPARATOR);
define('COREPATH', realpath('/var/www/vhosts/grubber.co.nz/httpdocs/fuel/core/').DIRECTORY_SEPARATOR);                  
require APPPATH.'bootstrap.php';

error_reporting(-1);
ini_set('display_errors', 1);

$to = $_GET['to'];
$from = $_GET['from'];
$message = $_GET['message'];


$dquotes = '"';
$squotes = "'";

$message = str_replace($dquotes, "&quot", $message);
$message = str_replace($squotes, "&#039", $message);

DB::insert('chatmes')->set(array('id' => '1', 'to' => 'freddy', 'from' => 'bob', 'message' => 'message', 'checked' => '1'))->execute();

?>

I don’t know what I am doing wrong. Also the connection I’m using is PDO.

At the moment the only line thats giving me a error is the DB update query.

  • 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-15T23:26:52+00:00Added an answer on June 15, 2026 at 11:26 pm

    I have figured it out, it had nothing to do with my query, it was fuelphp. It didn’t like the database from to sender and to to receiver.
    Thanks guys for helping.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't know what to do with this error. How to add data in SQL
Don't get me wrong PDO is great but what I don't like about it,
Don't get me wrong - I love Smalltalk, but... To me, the Squeak interface
Don't know why this conversion fails. SELECT CAST('32.999' AS INT) throws the error saying
Don't get me wrong, I want them to get saved. But I always thought
I don't know why my site give me this error. This is the list
Don't dismiss this as a newbie question! It's not, I'm not, I've tried everything,
I don't know why, but this code worked for me a month ago... maybe
Don't these two mean the same thing, first get the value and then increment?
Don't ask why, but is there any way to suppress a failed linking error?

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.