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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:26:21+00:00 2026-06-01T14:26:21+00:00

I have written several procedures and succesfully implemented them on my webhost’s server. However

  • 0

I have written several procedures and succesfully implemented them on my webhost’s server. However with this procedure i get the #1064 error. I wrote it in MySQL Workbench and it did not complain one bit. Works fine on my local machine.

USE mydb
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `temp`(
  IN p_page int(11),
  IN p_approved varchar(3))
  BEGIN
    DECLARE v_postsPerPage tinyint;
    DECLARE v_totalPostCount int(11);
    DECLARE v_listFrom int(11);

    SELECT posts_per_page INTO v_postsPerPage FROM diskus_settings;

    SELECT COUNT(*) INTO v_totalPostCount FROM diskus_post;

    SET v_listFrom = p_page * v_postsPerPage - v_postsPerPage;

    SELECT p.post_id, p.user_id, u.username, get_time_diff(p.date) as date, p.ip, p.text, p.parent_post_id, p.approved AS posts
    FROM diskus_post p, diskus_user u
    WHERE p.user_id = u.user_id
      AND p.approved = p_approved
    ORDER BY p.date DESC LIMIT v_listFrom, v_postsPerPage;
END $$
  • 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-01T14:26:22+00:00Added an answer on June 1, 2026 at 2:26 pm

    This should work –

    USE mydb
    DELIMITER $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `temp`(IN p_page int(11), IN p_approved varchar(3))
      BEGIN
        DECLARE v_postsPerPage tinyint;
        DECLARE v_totalPostCount int(11);
        DECLARE v_listFrom int(11);
    
        SELECT posts_per_page INTO v_postsPerPage FROM diskus_settings;
    
        SELECT COUNT(*) INTO v_totalPostCount FROM diskus_post;
    
        SET v_listFrom = p_page * v_postsPerPage - v_postsPerPage;
    
        SET @sql = CONCAT('SELECT p.post_id, p.user_id, u.username, get_time_diff(p.date) as date, p.ip, p.text, p.parent_post_id, p.approved AS posts
            FROM diskus_post p, diskus_user u
            WHERE p.user_id = u.user_id
            AND p.approved = p_approved
            ORDER BY p.date DESC
            LIMIT ', v_listFrom, ', ', v_postsPerPage);
    
        PREPARE stmt FROM @sql;
        EXECUTE stmt;
        DEALLOCATE PREPARE stmt;
    END $$
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am adapting a little rmi client-server application. I have written several things :
I have written the majority of my project in C++. However there are several
so I have written several stored procedures that act on individual rows of data
I have written several scripts for my hudson builds. I have place them in
I have written a C# app that runs constantly in a loop and several
I have written a console application in Delphi that queries information from several locations.
I have written a base class from which I wish to derive several child
I have written a Scala (2.9.1-1) application that needs to process several million rows
I have written a WinForms application (C# 2.0, VS2008) that registers several file types
Background I have an application written in native C++ over the course of several

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.