datalee100 Posted July 14, 2007 Share Posted July 14, 2007 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); Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2007 Share Posted July 14, 2007 <?php $connection = mysql_connect('sql06.freemysql.net','daralee100','*******'); $db = mysql_select_db('tcglinking', $connection); ?> Quote Link to comment Share on other sites More sharing options...
yzerman Posted July 14, 2007 Share Posted July 14, 2007 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. Quote Link to comment Share on other sites More sharing options...
datalee100 Posted July 14, 2007 Author Share Posted July 14, 2007 $sql = "SELECT username,siteurl,urlbanner FROM TABLE"; So to run that, it would be the same way? Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2007 Share Posted July 14, 2007 So to run that, it would be the same way? What do you meen? That is valid php syntax. You have an sql error there though as TABLE is a reserved word. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 14, 2007 Share Posted July 14, 2007 we use quote for non variables and functions Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2007 Share Posted July 14, 2007 teng... if your going to reply can you at least try and make sense. That last post says nothing. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 14, 2007 Share Posted July 14, 2007 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 Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2007 Share Posted July 14, 2007 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. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 14, 2007 Share Posted July 14, 2007 tell me why dude cool Quote Link to comment Share on other sites More sharing options...
datalee100 Posted July 14, 2007 Author Share Posted July 14, 2007 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? Quote Link to comment Share on other sites More sharing options...
datalee100 Posted July 14, 2007 Author Share Posted July 14, 2007 Anyone have any ideas? I won't be here to try stuff and reply until Thursday, but I would really like an answer... Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.