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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:46:35+00:00 2026-05-17T18:46:35+00:00

Is there any way to turn on driver logging for PHP/MySQL 5? Is there

  • 0

Is there any way to turn on driver logging for PHP/MySQL 5? Is there a log that shows internally what’s going on… like all database activity? Lower-level errors?

I’m trying to get a trivial PHP page to call a trivial stored proc on Windows 7. mysql_error isn’t returning any error message when the mssql_init() fails.

Thinking it might be a permission problem I created a new user and I get the same results:

CREATE USER 'user1'@'localhost' IDENTIFIED BY 'pass1';
GRANT ALL ON *.* TO 'user1'@'localhost';

Here is the code:

create table trace (
    trace varchar(50) not null,
    datet datetime not null
);

drop procedure if exists mark;
delimiter !!
create procedure mark()
begin
    insert into trace (trace,datet) values ('mark',now());
end; !!
delimiter ;

I can call the SP from MySQL Workbench just fine:

call mark();

Here is the PHP page:

<?php
$connection = mysql_connect('localhost', 'user1', 'pass1');
if (!$connection) {
    die('Could not connect: ' . mysql_error());
}

$sel = mysql_select_db('tw');
if (!$sel) {
    die('Could not select_db: ' . mysql_error());
}

//$stmt = mssql_init('mark', $connection);
//$stmt = mssql_init('mark', $sel);
$stmt = mssql_init('mark');
if (!$stmt) {
    die('Could not init: ' . mysql_error());
}

$result = mssql_execute($stmt);
if (!$result) {
    die('Could not execute: ' . mysql_error());
}

mysql_free_result($result);

mssql_free_statement($stmt);

mysql_close($connection);

printf("DONE<br />"); 
?>

Other proof of concept pages which demonstrate insert, *select,* etc, are working just fine. Just can’t get a stupid stored procedure to run from a web page!

The page output is only this:

Could not init:

(The PHP mssql_init documentation page isn’t very helpful and seems to have a typo as the $link variable isn’t defined.)

  • 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-05-17T18:46:36+00:00Added an answer on May 17, 2026 at 6:46 pm

    You’re using mssql_init (Note MS SQL) to execute a stored procedure on My SQL.

    Obviously the mssql_init() function can’t find your Microsoft SQL Server connection ’cause you don’t have one. You should only be using mysql_ functions for a MySQL connection.

    And MySQL doesn’t have a special function for calling stored procedures. mysql_query('CALL mark()') will work just fine.

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

Sidebar

Related Questions

Is there any way to turn off all console.log statements in my JavaScript code,
Are there any way to turn of the autoformatting of C# code that is
Is there any way to turn off antialias for all text in a plot,
Once a project has been created (PHP) is there any way to turn on
Is there any way to turn the damned error provider off when i try
Is there any way I can set a formatter on models that will convert
Is there any way to achieve compiling Node.js scripts as native code, like Hip-Hop
I am using PHP SQL Server driver - is there a way to kill
Is there any way to turn off permalinks only for tags in WordPress? I'd
Is there any way to encode ALL urls in Drupal? I.e. Instead of something

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.