Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The state of DevOps and AI: Not just hype

      September 1, 2025

      A Breeze Of Inspiration In September (2025 Wallpapers Edition)

      August 31, 2025

      10 Top Generative AI Development Companies for Enterprise Node.js Projects

      August 30, 2025

      Prompting Is A Design Act: How To Brief, Guide And Iterate With AI

      August 29, 2025

      Look out, Meta Ray-Bans! These AI glasses just raised over $1M in pre-orders in 3 days

      September 2, 2025

      Samsung ‘Galaxy Glasses’ powered by Android XR are reportedly on track to be unveiled this month

      September 2, 2025

      The M4 iPad Pro is discounted $100 as a last-minute Labor Day deal

      September 2, 2025

      Distribution Release: Linux From Scratch 12.4

      September 1, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Enhanced Queue Job Control with Laravel’s ThrottlesExceptions failWhen() Method

      September 2, 2025
      Recent

      Enhanced Queue Job Control with Laravel’s ThrottlesExceptions failWhen() Method

      September 2, 2025

      August report 2025

      September 2, 2025

      Fake News Detection using Python Machine Learning (ML)

      September 1, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Installing Proxmox on a Raspberry Pi to run Virtual Machines on it

      September 2, 2025
      Recent

      Installing Proxmox on a Raspberry Pi to run Virtual Machines on it

      September 2, 2025

      Download Transcribe! for Windows

      September 1, 2025

      Microsoft Fixes CertificateServicesClient (CertEnroll) Error in Windows 11

      September 1, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Message Oriented Database

    CodeSOD: Message Oriented Database

    April 15, 2025

    Mark was debugging some database querying code, and got a bit confused about what it was actually doing. Specifically, it generated a query block like this:

    <span class="hljs-variable">$statement</span>=<span class="hljs-string">"declare @status int
            declare @msg varchar(30)
            exec @status=sp_doSomething 'arg1', ...
            select @msg=convert(varchar(10),@status)
            print @msg
            "</span>;
    
    <span class="hljs-variable">$result</span> = <span class="hljs-title function_ invoke__">sybase_query</span> (<span class="hljs-variable">$statement</span>, <span class="hljs-variable">$this</span>->connection);
    

    Run a stored procedure, capture its return value in a variable, stringify that variable and print it. The select/print must be for debugging, right? Leftover debugging code. Why else would you do something like that?

    <span class="hljs-keyword">if</span> (<span class="hljs-title function_ invoke__">sybase_get_last_message</span>()!==<span class="hljs-string">'0'</span>) {
        ...
    }
    

    Oh no. sybase_get_last_message gets the last string printed out by a print statement. This is a pretty bonkers way to get the results of a function or procedure call back, especially when if there are any results (like a return value), they’ll be in the $result return value.

    Now that said, reading through those functions, it’s a little unclear if you can actually get the return value of a stored procedure this way. Without testing it myself (and no, I’m not doing that), we’re in a world where this might actually be the best way to do this.

    So I’m not 100% sure where the WTF lies. In the developer? In the API designers? Sybase being TRWTF is always a pretty reliable bet. I suppose there’s a reason why all those functions are listed as “REMOVED IN PHP 7.0.0”, which was was rolled out through 2015. So at least those functions have been dead for a decade.

    [Advertisement]
    Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous Article11 Vibe Coding Tools to 10x Your Development on Linux Desktop
    Next Article A Coding Guide to Build a Finance Analytics Tool for Extracting Yahoo Finance Data, Computing Financial Analysis, and Creating Custom PDF Reports

    Related Posts

    News & Updates

    Look out, Meta Ray-Bans! These AI glasses just raised over $1M in pre-orders in 3 days

    September 2, 2025
    News & Updates

    Samsung ‘Galaxy Glasses’ powered by Android XR are reportedly on track to be unveiled this month

    September 2, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-31261 – Apple macOS User Data Access Permissions Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    I played Marvel Cosmic Invasion — pure, simple co-op fun that shouldn’t be missed

    News & Updates

    CodeSOD: Format Identified

    News & Updates

    A Step-by-Step Coding Guide to Building an Iterative AI Workflow Agent Using LangGraph and Gemini

    Machine Learning

    Highlights

    Rack::Static Vulnerability Exposes Ruby Servers to Data Breaches!

    April 28, 2025

    Rack::Static Vulnerability Exposes Ruby Servers to Data Breaches!

    Hold onto your keyboards, Ruby developers! 😱 A critical security flaw in the Rack::Static middleware has been uncovered, potentially leaving Ruby-based web servers vulnerable to data breaches. Dubbed …
    Read more

    Published Date:
    Apr 28, 2025 (2 hours, 53 minutes ago)

    Vulnerabilities has been mentioned in this article.

    Dune: Awakening not working on PC (Tested Fixes)

    June 18, 2025

    Community News: Latest PECL Releases (04.15.2025)

    April 15, 2025

    How to install and use Ollama to run AI LLMs on your Windows 11 PC

    May 13, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.