Jump to content
php.lv forumi

Mysql Connect


jonass

Recommended Posts

<?

$db = mysql_connect("adrese","usr","pass");

mysql_select_db("table","$db");

$res = mysql_query("select sss from table");

?>

man izmet:

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in E:testimysql1.php on line 3

 

kaapeec taa?

Link to comment
Share on other sites

Nu a tev piesleedzas normaali?

 

Pie kam principaa nevaig taisiit $db = mysql_connect() to izmanto tikai tad ja vienlaiciigi nepiecieshams piesleegties vairaakiem MySQL serveriem.

 

Pietiek shaadi

 

mysql_connect($hostname,$dbUser,$dbPass);

mysql_select_db($dbName);

Link to comment
Share on other sites

<?

$db = mysql_connect("adrese","usr","pass");

mysql_select_db("table","$db");

$res = mysql_query("select sss from table");

?>

man izmet:

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in E:testimysql1.php on line 3

 

kaapeec taa?

pie mysql_select_db nevaig likt $db peedinjaas, tad viss buus ok. .. Tev tiek prasiits parametrs MySQL konekcija, bet shaadaa veidaa tu iedod vinjam kaut kaadu stringu, kas labaakajaa gadiijumaa satur mysql konekcijas kaut kaadu informaaciju.

Tb, tam jaaizskataas shitaa:

<?

$db = mysql_connect("adrese","usr","pass");

mysql_select_db("table",$db);

$res = mysql_query("select sss from table");

?>

 

protams, paliek speekaa arii tas, ko Roze ieteica ;)

Link to comment
Share on other sites

×
×
  • Create New...