Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript Site
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Show links from a certain category

 

OK you only want to show the links from one category, this is how you do it. In this example we want to see the links from the search category.


 

 

<?php
//connect to server with username and password
$connection = mysql_connect ("localhost","username", "password") or die ("Cannot make the connection");
//connect to database
$db = mysql_select_db ("test",$connection) or die ("Cannot connect to database");
//our SQL query
$sql_query = "SELECT * FROM test WHERE cat like 'search'";
//store the SQL query in the result variable
$result = mysql_query($sql_query);
if(mysql_num_rows($result))
{
//output as long as there are still available fields
while($row = mysql_fetch_row($result))
{
echo ("<a href=\"$row[2]\">$row[3]</a>");
echo (": $row[4]<br>");
}
}
//if no fields exist
else
{
echo "no values in the database";
}

?>

lets take a look now



 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
hexadecimal to decimal conversion(PHP)
Open notepad when a key is pressed(VB)
Temperature Conversion(ASP)
write to a file using the filesystemobject(ASP)
Get I.P address(ASP)
space between text(CSS)
find a string in another(PHP)
Launch new hardware wizard(VB)

    




Copyright © 2004 by programmershelp.co.uk