• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 46
  • Last Modified:

SQL Databse credetials?

Hey, i'm trying to connect to SQL database with this code, but it refuses to connect what ever i type in there, i don't know wich user/password/ip i need to type in.

<?php
date_default_timezone_set('UTC');

define("", "");

$db_host     = "";
$db_user     = "";
$db_password = "";
0
Marcus P
Asked:
Marcus P
  • 4
2 Solutions
 
Ryan ChongCommented:
but it refuses to connect what ever i type in there, i don't know wich user/password/ip i need to type in.
well, you need to know what that error message means, share it here if necessary

it could be different reasons why you can't connect to your database via your php codes.
1
 
David Johnson, CD, MVPOwnerCommented:
it also depends upon the database itself. Each database product has different ways of connecting and deciding what IP addresses are allowed. .
1
 
Ryan ChongCommented:
if you mean connecting to:

MS SQL
Sample code to connect to an MS SQL database using php
https://support.winhost.com/kb/a687/sample-code-to-connect-to-an-ms-sql-database-using-php.aspx

MySQL
How to connect to MySQL using PHP
https://www.a2hosting.sg/kb/developer-corner/mysql/connect-to-mysql-using-php
0
 
Ryan ChongCommented:
any further assistance needed here?
0
 
Ryan ChongCommented:
as proposed
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now