⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

SQL SERVER ERROR



Ahmir
  • profile picture
  • Member

Posted 27 July 2017 - 17:08 PM

Hello, I am following the tutorial to start with GroceryC. Once create Main.php and the function ''programas()'' in my case, I receive the following error:

An uncaught Exception was encountered
 
Type: Error
 
Message: Call to undefined function mssql_connect()
 
Filename: C:\xampp\htdocs\editor\system\database\drivers\mssql\mssql_driver.php
 
Line Number: 113
 
Backtrace:
 
File: C:\xampp\htdocs\editor\application\controllers\Main.php
 Line: 10
 Function: database 
 
File: C:\xampp\htdocs\editor\index.php
 Line: 315
 Function: require_once 
 
 
I am using XAMPP with PHP 7.1.X.
 
As far as I know, the ''mssql_connect'' should be ''sqlsrv_connect()'', or not?

 

 

 

Thank you


Amit Shah
  • profile picture
  • Member

Posted 27 July 2017 - 17:21 PM

Well.. this is a bug seems with configurations .. please check it on the same on google / stackoverflow ...

Out of the box.. still from the above error of yours.. what gets conveyed is - you have not enabled mssql driver in php ... u need to activate it.. and it is only post that the connectivity from the program can be made.

 

Happy GCing :)


Ahmir
  • profile picture
  • Member

Posted 27 July 2017 - 17:28 PM

Thank you for your quick response. Actually I do have activated mssql on PHP and checked the connection to the DB.... I think PHP 7.X deoesnt supports the ''mssql_..''


Amit Shah
  • profile picture
  • Member

Posted 27 July 2017 - 18:01 PM

Well.. my experience is.. php / mssql dont go very good.. hand in hand..

and the driver provided with php .. mostly dont seem to work so well..

there were times i downloaded driver from MS site that provided drivers for php / mssql

also.. there are a certain condition .. basis of the sql client available.. there will be driver available

and that too will work with specific version of php.

 

Hope this info might be of some good use 4 u..

Happy GCing :)


Ahmir
  • profile picture
  • Member

Posted 27 July 2017 - 23:22 PM

Thank you for your reply Amit. Actually, the problem is that my company uses Microsoft SQL server... I would have prefered MariaDB but these are the conditions. So now I am trying to make use this CRUD for my personal usage of edit, delete, filter DATA from our DB.

 

I also have searched for some kind of Mysql and MSSQL union through a connector or something, but no way. Any suggestions?

 

 

BTW, I have installed PHP 7.0 and installed the mssql drivers, now I am getting the following error:

 

Error Number: 42000/156

[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near the keyword 'FROM'.

SHOW COLUMNS FROM ``

Filename: C:/wamp/www/editor/system/database/DB_driver.php

Line Number: 691

 

 

 

 

Thanks for your patients..


Ahmir
  • profile picture
  • Member

Posted 04 August 2017 - 12:39 PM

Help please..


Amit Shah
  • profile picture
  • Member

Posted 06 August 2017 - 03:46 AM

did u try using the mssql drivers provided by Microsoft? Also .. in caseu tried it.. .please do check if they are getting loaded correctly in the error log ... There might be possibility that the driver might not be getting loaded correcrtly @all.. that is also 1 reason as why it says....undefined function


Ahmir
  • profile picture
  • Member

Posted 07 August 2017 - 10:00 AM

I am having the following error in PHP 7.0.

 

 

Error Number: 42000/156

[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near the keyword 'FROM'.

SHOW COLUMNS FROM ``

Filename: C:/wamp/www/editor/system/database/DB_driver.php

Line Number: 691


Amit Shah
  • profile picture
  • Member

Posted 07 August 2017 - 18:22 PM

Well now that is a different story.. you are getting this error .. indicating that the same is functional.. currently with ODBC driver.. i was talking about the raw drivers  

Anyways - it purely indicates that there is no table name specified .. that is the cause .. specify the same .. and it should get resolved.