English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi, i am designing a DJ web site for my uni project. now i have managed to write a search script but i need futher help. For example if the user searches for DJ's which play House music he will end up with about 25 results. The results display as a list. What i want to do is make that list into links. So for example if the user clicked on any name in the list it would load up the dj's profile. How do i make the link in php so i dont have to write a seperate html file for each dj?

2007-05-08 05:00:23 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

My database fields are
DJ_ID (which is the primary key,and auto increment)
DJ_Nickname
Real_Name
Genre
etc...

2007-05-08 05:01:28 · update #1

3 answers

Use php to build a table:
$display_string ="

.......
......."; //First row headings
$ result = mysql_query("select * from tablename where fieldwhichever ='house'"); //Sets query
while ($record = mysql_fetch_array($result)){
$display_string .=""; //Each data row
}
$display_string .="
Name
$record[name] ......
"; // finishes display

To activate the link in the data line use whichever link (say an id field) is easiest to use (I will put it in the name cell :

" .....
$record[name]
This allows the called page (profilepage.php) to use the $_GET[dj_id] to search the data and build a page the same way.



Then use :
echo $display_string;
?>

2007-05-08 05:20:17 · answer #1 · answered by Anonymous · 0 0

you need to create a display page with the ID for each DJ as the where ID = DJID and then just create an html link with the href='displayinfo.php?ID=<%DJID%>' or something like that

read over http://www.freewebmasterhelp.com/tutorials/phpmysql for help.

2007-05-08 12:08:27 · answer #2 · answered by Erik S 2 · 0 0

Connection for PHP - MYSQL

$vt_localhos = 'localhost';
$vt_username = 'root';
$vt_password = '';
$vt_name = 'djetcetc';

@ $mysql_connection = mysql_connect($vt_localhos,$vt_username,$vt_password);
@ mysql_select_db($vt_name,$mysql_connection);
if (mysql_errno())
{
echo 'Error: cannot connect DB Blabla.. Try again ';
exit;
}
mysql_query("SET NAMES 'latin5'");
unset($vt_localhos,$vt_username,$vt_password,$vt_name);
?>

2007-05-08 12:10:36 · answer #3 · answered by jok3r 4 · 0 0

fedest.com, questions and answers