Quick DB Question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sailingaway
Forum Newbie
Posts: 2
Joined: Mon Sep 09, 2002 3:59 pm
Location: GA

Quick DB Question

Post by sailingaway »

I am new to MySQL and PHP so be kind!

If I have a MySQL DB and I want to search that DB using certain criteria such as Last Name and I want all those records to be returned on one "results page" and each result be a link to the entire record, what is that called and how do I do it. For example, If I search my DB for a last name of Jones and it returns 5 Jones' how can I make each result a link to the respective records? Any help would be appreciated.

Thanks,
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

http://www.mysql.com/doc/en/SELECT.html

enjoy...

try asking google for a beginners guide to sql :)
or go to the library/buy one (thats what i did)

*edits in a little more detail....*
*edits out retardedness :oops:*
something like...

Code: Select all

<?php
$result = mysql_query("SELECT * FROM Table WHERE Lname = Jones SORT BY Fname");
while ($row = mysql_fetch_array($result)){
     echo "stuff from $row"
}

?>
Post Reply