0

Connection String

define('HOSTNAME', 'localhost');
define('USERNAME', 'khabarez_naveed');
define('PASSWORD', 'naveed');
define('DATABASE', 'khabarez_naveed');
$dbLink = mysql_connect(HOSTNAME, USERNAME, PASSWORD);
mysql_query("SET character_set_results=utf8", $dbLink);
mb_language('uni');
mb_internal_encoding('UTF-8');
mysql_select_db(DATABASE, $dbLink);
mysql_query("set names 'utf8'",$dbLink);

Select Query

$query ="SELECT * FROM test";
$result=mysql_query($query)
or die ("Connection to database table failed. 106."  . mysql_error() );
while($row = mysql_fetch_array($result))

{

//$result_no=mysql_query("select count(*) as tot from news_master_tl entType ='lm' AND entSts ='Y' AND entCode ='$row[entCode]' ");
//$row_no=mysql_fetch_assoc($result_no);
//$TotalReg = $row[TotalReg];

?>

<tr onmouseover="this.style.backgroundColor='yellow' " onmouseout="this.style.backgroundColor='white'"  >

<td style="border: 0px solid gray;"><a href="home.php?page=classi&type=tit"><?php echo $row['aa']?></a></td>
<td style="border: 0px solid gray;">0</td>
</tr>

<?php
}
?>
</table>

Error
Connection to database table failed. 106.No database selected

Edited by Dani: Formatting fixed

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by almostbob
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.