is it able somehow to connect web with MySql database? i tryed to do it... i needed to write DB Host, so wrote localhost and for me says that "Cannot connect to database" so maybe DB host is not localhost, just i can't find any other
is it able somehow to connect web with MySql database? i tryed to do it... i needed to write DB Host, so wrote localhost and for me says that "Cannot connect to database" so maybe DB host is not localhost, just i can't find any other
It is localhost, make sure you set up the database beforehand via the MySQL database wizard in cpanel
█ Ryan Schmidt | Level 2 Support
█ 888-X10-9668 - ryan[@]x10hosting.com
█ x10Hosting - Giving Away Hosting Since 2004
█ Premium Hosting | VPS Services
Hm i gues i'll recreate database, afterall i need 2 of them :/ and then maybe something will work
---------- Post added at 08:27 PM ---------- Previous post was at 08:16 PM ----------
EDIT: recreated database... still getting same error "I cant connect to localhost server." I wrote "localhost" in "DB Host:" section
This is a script on your x10 account?
Nothing is always absolutely so.
Give this a try
PHP Code:<?php
$username ='jondoe';
$password = '12345678';
$database = 'jondoe_mydatabase';
// NB the full db name is your username plus whatever you called the database
$con = mysql_connect("localhost",$username,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($database, $con);
echo 'database connected';
?>
Last edited by cybrax; 11-29-2011 at 03:00 PM.
The code must flow.
Project 157: Latest UK Jobs direct to your mobile phone
New Domain under construction: Lovelogic.net
home for some new projects that we can't keep here ;)