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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:39:30+00:00 2026-06-13T20:39:30+00:00

I am using a MVC framework and have a problem in a SQL query.

  • 0

I am using a MVC framework and have a problem in a SQL query.

The user that publish a post on my website receives an email containing a confirmation URL :

mywebsite.com/confirm/f9b83b3bf994e5db3b06ya20eb306a24/

The routing is made correctly, but I would like to change the SQL “published” field to 1 (it is set to 0 by default)

So basically, everything is working except my UPDATE SQL query, it’s probably something stupid but I am a beginner in this domain and I couldn’t fix it after many tries.

    if(substr(ROUTE, 0, 8) == 'confirm/')
        {
            if(strlen($code = substr(ROUTE, 8, 32)) == 32)
            {
                if($row = db::fetch(db::query('SELECT `id` FROM `'.DB_PREFIX.'Posts` WHERE `published`=0 AND `confirm`="'.db::escape($code).'"'), 'row'))
                {

//This is the problematic line
                 db::query('UPDATE '.DB_PREFIX.'Posts SET published=1 WHERE published=0 AND confirm="'.db::escape($code).'"');

                }
            }

            header('Location: '.WEB.'publish_success.html');
        } 

Thank youf or your help 🙂

Edit : Problem fixed adding the WHERE clause !

  • 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-13T20:39:31+00:00Added an answer on June 13, 2026 at 8:39 pm

    There’s no WHERE clause in your UPDATE command.

    db::query('UPDATE `'.DB_PREFIX.'.Posts` SET `published`=1 WHERE id = ' . $row['id'] );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using MVC (C#) and the Entity Framework. I have a sql server
I have an ASP.NET MVC 3 app that is using SQL Server CE 4.0
I am using .net entity framework, asp.net mvc, sqlexpress and have one problem: when
Using ASP MVC and Entity Framework. In the view, you have a page declaration
I have a PHP MVC application using Zend Framework. As presented in the quickstart,
All, I have a PHP Web application built using Zend Framework and MVC with
I am using the asp.net mvc with the Entity Framework. I have a list
I'm creating a website using MVC framework (Yii) and I need to dynamically create
Recently I've started to write on asp.net mvc framework. I have a problem. I
I have just created a mid-sized web-application using Java, a custom MVC framework, javascript.

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.