Help - Search - Members - Calendar
Full Version: Sql Really Easy One
Zymic Webmaster Forums > Zymic Free Web Hosting > Zymic Free Web Hosting - General Discussion & Help
dunkyboy77
Hi, just started with this stuff - have set up database: duncanmatthews_zxq_net_mydbase.* from PhPAdmin, but can't connect to it.
Have set up user: duncan which becomes: duncanmatthews_zxq_net_duncan
Can anyone tell me what I am doing wrong below. It goes through to the die() part and shows me that message.
Take a look http://www.duncanmatthews.zxq.net/

<?php
$connection = @mysql_connect("www.hosting.zymic.com", "duncanmatthews_zxq_net_duncan", "I put user pwd here")
or die("Sorry unable to connect to MySQL");
echo("Congratulations - you connected to MySQL");
?>

Thanks clever people.
Ed
Sorry, this an issue with Zymic hosting, at the moment usernames which exceed 16 characters fail to connect, it's an issue we're aware of and are trying desperately to fix.
dunkyboy77
Thanx for fast reply Bread - I will be patient and am delighted with the free hosting. I just wanted to check that what I was putting in my code was otherwise correct, or I'll never know whether it's me or the service. Does it look right to you?
Ed
Forgot to mention there is one issue with your statement, the host needs to be 'localhost', apart from that, on a normal day it should work.

You might want to add your mysql_select_db too; might I suggest if you're new in getting to grips with MySQL in php that you start on MySQLi, it's the improved library and it's definitely the way forward.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.