Jump to content
php.lv forumi

php izēlas pieejamo mysql pieslēkšanos


ziedinjsh

Recommended Posts

Sveiki!

Man tāds jautājums: Kā var uztaisīt ka mysql izvēlas pie kuras db slēgties.

 

Piem viens man ir uz lokālo serveri un otrs man ir uz hostinga.. veicot kkādus papildinājumus pārakstās pāri config fails un atkal jāraksta manuāli

 

Doma:

<?php
if(hosts){
$dbase = mysql_connect("localhost", "root", "1234567890") or die(mysql_error());
mysql_set_charset('utf8',$dbase);
mysql_select_db("nosaukums_us_hosta") or die(mysql_error());
}else{
$dbase = mysql_connect("localhost", "root", "0987654321") or die(mysql_error());
mysql_set_charset('utf8',$dbase);
mysql_select_db("nosaukums_majaas") or die(mysql_error());
}
?>

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...