Custom Search
 


<?
$db_host 
"localhost"
$db_name "northwind"
$db_user "root"
$db_pass "your_password"

$db_link mysql_connect($db_host$db_user$db_pass$db_name); 

// Here we select all records from categories table. 
$sql "select CategoryID, CategoryName from categories"
$result mysqli_query($db_link$sql); 

// Loop thru the record set and concatenate a TR string for HTML table. 
while($row mysqli_fetch_array($resultMYSQLI_ASSOC)) 

    
$cat_id $row["CategoryID"]; 
    
$cat_name $row["CategoryName"]; 
     
    
$tr .= "<tr><td>"$cat_id"</td>"
        
"<td>"$cat_name"</td></tr>"

?> 

<p> 
<table cellpadding=2 cellspacing=0 border=1> 
<tr> 
    <th><strong>Category ID</strong></th> 
    <th><strong>Category Name</strong></th> 
</tr> 
<?=$tr?> 
</table></p>

Copyright © 2024 GeeksEngine.com. All Rights Reserved.

This website is hosted by HostGator.

No portion may be reproduced without my written permission. Software and hardware names mentioned on this site are registered trademarks of their respective companies. Should any right be infringed, it is totally unintentional. Drop me an email and I will promptly and gladly rectify it.

 
Home | Feedback | Terms of Use | Privacy Policy