Jump to content

Error: Can't call the database


datalee100

Recommended Posts

I'm getting:

 

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'sql06freemysqlnet' (1) in /home/.lafayette/musica/musica.clavis-sama.com/ttcg/members.php on line 6

 

But on the file my sql host is sql06.freemysql.net.  Where did the periods go?  The original coding is:

 

$connection = mysql_connect(sql06.freemysql.net,daralee100,*******); 
    $db = mysql_select_db(tcglinking, $connection);

Link to comment
Share on other sites

you need to use single quotes.

 

Should be

 

$mysql_connect = mysql_connect('host','username','password');

 

Using a string like blah.somewhere.blah without quotes, php takes those and combines them as one value, which is why you have no periods in your warning.

Link to comment
Share on other sites

teng... if your going to reply can you at least try and make sense. That last post says nothing.

 

dude how old are you you always seems mad High blood lol

what im trying to say is that all non varaibles and function are required to have a quote

am i wrong with that lol

 

cool thorpe cool ;D

Link to comment
Share on other sites

am i wrong with that

 

Indeed you are wrong with that.

 

The point I was making is that you often seem to poke in with a one liner that makes little sense. This doesn't help people who are trying to understand.

 

Now even with your further explanation of your last comment we see that you where incorrect anyway. Its easier if you don't know what your talking about to just leave your comments out.

Link to comment
Share on other sites

Alright, changing TABLE to my correct table takes away the errors, but now it's not calling the right stuff from the database...  This is the link:

 

http://musica.clavis-sama.com/ttcg/members.php

 

Basically, it's written so that in one of the table boxes it's a button that links with the info from the database I.E.:

 

$link = "<a href='$row[siteurl]'><img src='$row[urlbanner]'>";

 

Should bring up a link with the siteurl from the database as the link and the urlbanner variable as the image...  Do these need the single quote around them as well?  They're called in by:

 

$sql = "SELECT username,siteurl,urlbanner FROM exchange";

 

And used as:

 

echo "<table border=0 cellspacing=0 cellpadding=2 width=200>";
echo "<tr><td>Site Banner<td>Owner";
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
    echo "<tr><td>";
    printf ("%s $td $link %s $el", $row[0], $row["username"]);

 

Which also should show the username in the correct area.  Comments?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.