By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,067 Members | 1,818 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,067 IT Pros & Developers. It's quick & easy.

error msg for mssql_query()

P: 43
Hi everyone,
I am getting a confusing error message, I have done some googling an can't find a good solution.

My error message is :

Fatal error: Call to undefined function mssql_query() in C:\xampp\htdocs\dbf\database_files\AddUsers1.php on line 24

The code that is generating this error is :

Expand|Select|Wrap|Line Numbers
  1. $q1 = mssql_query("INSERT INTO users (name, surname, dob, status) VALUES ('$name', '$surname', '$birthdate', '$status') SELECT
  3. $r = mssql_fetch_assoc($q1);
  5. $insert_id = $r['SCOPE_IDENTITY'];
  6. echo $insert_id;
I have tried the insert with just mysql_query() and it works great, so there is no problem with the variables or connection.

Also a second question, could someone please provide a explanation as to how SCOPE_IDENTITY() works because Google has not been very helpful in giving me an explanation I can understand clearly.

Thank you for any and all help,
Apr 10 '11 #1
Share this Question
Share on Google+
3 Replies

code green
Expert 100+
P: 1,726
Looks like you don't have mssql enabled in the php.ini file.
The statements will be there, They just need un-editing or setting to true,
Apr 12 '11 #2

P: 43
Oh ok cool, thanks a lot I will give it a look when I get home and let you know if it works out.
Thanks code green

Apr 12 '11 #3

P: 43
Hey so perhaps someone can help give me a lil more direction on what I need to do cos I still cannot figure it out.

I am using xampp and my directory looks like this
and I am assuming that the ini file that I need to alter will be in the php folder within xampp.
I think this cos I have looked in most of them and the only ones with ini files are in the php folder.

So in the folder there are 3 files called 'php'.
one is of type 'configuration setting'
one is of type 'INI DEVELOPMENT FILE'
one is of type 'INI PRODUCTION FILE'

I assumed that I should alter the config type file.
I did a word search for mssql and found this:
as well as a whole subsection titled mssql.
I enabled all of them but the function still doesn't work ??
Apr 13 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.