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

      Report: 71% of tech leaders won’t hire devs without AI skills

      July 17, 2025

      Slack’s AI search now works across an organization’s entire knowledge base

      July 17, 2025

      In-House vs Outsourcing for React.js Development: Understand What Is Best for Your Enterprise

      July 17, 2025

      Tiny Screens, Big Impact: The Forgotten Art Of Developing Web Apps For Feature Phones

      July 16, 2025

      Too many open browser tabs? This is still my favorite solution – and has been for years

      July 17, 2025

      This new browser won’t monetize your every move – how to try it

      July 17, 2025

      Pokémon has partnered with one of the biggest PC gaming brands again, and you can actually buy these accessories — but do you even want to?

      July 17, 2025

      AMD’s budget Ryzen AI 5 330 processor will introduce a wave of ultra-affordable Copilot+ PCs with its mobile 50 TOPS NPU

      July 17, 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

      The details of TC39’s last meeting

      July 18, 2025
      Recent

      The details of TC39’s last meeting

      July 18, 2025

      Reclaim Space: Delete Docker Orphan Layers

      July 18, 2025

      Notes Android App Using SQLite

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

      KeySmith – SSH key management

      July 17, 2025
      Recent

      KeySmith – SSH key management

      July 17, 2025

      Pokémon has partnered with one of the biggest PC gaming brands again, and you can actually buy these accessories — but do you even want to?

      July 17, 2025

      AMD’s budget Ryzen AI 5 330 processor will introduce a wave of ultra-affordable Copilot+ PCs with its mobile 50 TOPS NPU

      July 17, 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:

    $statement="declare @status int
            declare @msg varchar(30)
            exec @status=sp_doSomething 'arg1', ...
            select @msg=convert(varchar(10),@status)
            print @msg
            ";
    
    $result = sybase_query ($statement, $this->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?

    if (sybase_get_last_message()!=='0') {
        ...
    }
    

    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

    Too many open browser tabs? This is still my favorite solution – and has been for years

    July 17, 2025
    News & Updates

    This new browser won’t monetize your every move – how to try it

    July 17, 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

    This new Android 16 feature might give a big performance boost to older phones – here’s how

    News & Updates

    The Last of Us Part 2 Remastered is already available at a discounted price on Windows PC

    News & Updates

    AI agent deployments will grow 327% during the next two years. Here’s what to do now

    News & Updates

    CVE-2025-3847 – Markparticle WebServer SQL Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    Create a color contrast checker with HTML, CSS, and JavaScript

    July 4, 2025

    In this tutorial, we’ll create a color contrast tool that lets you check the accessibility…

    Google just gave Gmail a major AI upgrade, and it solves a big problem for me

    May 20, 2025

    markmap – build mindmaps with plain text

    July 17, 2025

    How to Apply CSS3 Transforms to Background Images

    July 16, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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