Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

PHP Code Won't Work :/

General discussions related to php

Moderators: macek, egami, gesf

PHP Code Won't Work :/

Postby DJWARP121 » Fri May 30, 2014 1:34 pm

Hi guys.. i have this basic code:

Code: Select all
<?php
// Create connection
$con=mysqli_connect("192.168.0.7","root","tester123","DATA1");

// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>


DATA1 Does Exist.

the server IP is 192.168.0.7

Root is the owner (From what i can tell)

the password is correct.

all i get on the page is the title in the tab.

Please help
DJWARP121
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri May 30, 2014 1:30 pm

Re: PHP Code Won't Work :/

Postby peterachutha » Sat May 31, 2014 11:05 pm

I am not sure but did you try

$con=mysqli_connect("localhost","my_user","my_password","my_db");

use the term 'localhost' instead of an IP address.
peterachutha
New php-forum User
New php-forum User
 
Posts: 10
Joined: Sat May 31, 2014 10:35 pm


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.