Hi I have 5 database and I need to count a row from a table each database. Hope someone can help me. Thanks.
you can use mysql_select_db to switch between databases and run a query on each one to get your count. if you need a combined count you can add your results after executing both queries. ex: mysql_select_db("database1",$con); $rs1 = mysql_query("SELECT COUNT(filed) FROM table1 where x=0",$con); mysql_select_db("database2",$con); $rs1 = mysql_query("SELECT COUNT(filed) FROM table2 where x=0",$con); /* code here to extract and add values from result sources */ Code (markup):