The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
lpr- how to print from page to page naamas03 Shell Programming and Scripting 4 12-26-2007 06:30 AM
scp-1.2.27 man page Tornado Red Hat 4 03-16-2007 08:09 AM
how do i make a web page Neil Peart UNIX for Dummies Questions & Answers 3 10-13-2005 12:04 PM
adding a man page jacob358 UNIX for Dummies Questions & Answers 1 08-08-2005 05:14 PM
map Page Down and Page up to ] and [ buddy_amazing AIX 0 03-01-2005 02:34 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-08-2003
perleo perleo is offline
Registered User
  
 

Join Date: Aug 2002
Location: Ireland
Posts: 139
PHP:page.php?id= ????

Hi, i have this script to read from mysql (layout below) and the script will display the course title, and a url to the id, but when i click on the url it just goes back to that page(displaying all the course titles)but when u click on a course title i want it to read from detail table in php and display all the data in detail. how would i modifie the script to do that??

<html>

<body>

<?php



$db = mysql_connect("localhost", "root");

mysql_select_db("compulearn",$db);

// display individual record

if ($id) {

$result = mysql_query("SELECT * FROM courses WHERE id=$id",$db);

$myrow = mysql_fetch_array($result);

printf("First name: %s\n<br>", $myrow["courses"]);




} else {

// show employee list

$result = mysql_query("SELECT * FROM courses",$db);

if ($myrow = mysql_fetch_array($result)) {

// display list if there are records to display

do {

printf("<a href=\"%s?id=%s\">%s %s</a><br>\n", $PHP_SELF, $myrow["id"], $myrow["courses"], $myrow[""]);

} while ($myrow = mysql_fetch_array($result));

} else {


echo "Sorry, no records were found!";

}

}


MYSQL TABLE

+------+-------------------+-------------------+
| ID | Courses | detail |
+------+--------------------+------------------+
| intro | Intoductions | This course....|
+------+--------------------+------------------+

Please someone tell me.i hope u understand what iam lookin for,.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:55 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0