Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Directory Submission Service   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 06-20-2006, 08:17 AM   #1 (permalink)
Inactive
 
Join Date: 06-20-06
Posts: 1
iTrader: 0 / 0%
Latest Blog:
None

swcobra is liked by many
Thumbs up how to retrieve results from Database on specific field

can anyone help me as how to retrieve information from the database on a specific field. the page on which i am working is here
http://apsi.in/member/directory.htm
i would appreciate if anyone can give me the code in php, by clicking any one of the state name on the right side, i would like to get the data on that state only.

for example click on "Andhra Pradesh", you get the result, but the result which you can see is the complete data from the database, i would like to get only from that particular state.

even in the search option, i am able to get, but from the html form, as you can see the page, i would like it to be from the page itself.

please someone help me for this

Krishna
swcobra is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 06-21-2006, 08:46 AM   #2 (permalink)
Inactive
 
Join Date: 06-18-06
Posts: 28
iTrader: 0 / 0%
Latest Blog:
None

Chexx is liked by many
I dont know how you have things setup, but maybe the database fields themselves need to be reworked?

Try setting the primary key in the DB as an auto increment ID, the Dr. name after, etc.

Then try:
have your regular sql statements then..

$stateid = $row['state_id']
$statename = $row['stats_name']
<a href=http://site.com/page?state=<? echo $stateid; ?>><? echo $statename; ?></a>
Chexx is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-23-2006, 08:47 AM   #3 (permalink)
v7n Mentor
 
Thanol's Avatar
 
Join Date: 10-13-03
Location: Central Ohio (Dublin)
Posts: 1,514
iTrader: 0 / 0%
Latest Blog:
None

Thanol is a highly respected web proThanol is a highly respected web proThanol is a highly respected web proThanol is a highly respected web proThanol is a highly respected web proThanol is a highly respected web proThanol is a highly respected web proThanol is a highly respected web proThanol is a highly respected web proThanol is a highly respected web proThanol is a highly respected web pro
Send a message via AIM to Thanol Send a message via MSN to Thanol Send a message via Yahoo to Thanol
Hopefully in your database, you have a column that lists the State of that any given entry belongs to. If you did that then all you need to do is add a WHERE statement to your MySQL query.

example:
Code:
$state = $_GET['state']; $result = mysql_query("SELECT * FROM $database_table WHERE state='$state'") or die(mysql_error()); $row = mysql_fetch_array( $result );
If your database isn't set up so that there is a column that attaches each entry to a state, I suggest that you edit the database so that it does.
__________________
-Scott
Build a Website : Other site
Thanol is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-29-2006, 03:15 PM   #4 (permalink)
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 72
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
Code:
<a href= "http://site.com?STATE-ID-HERE">STATE NAME HERE</a> $stateid = $_SERVER['QUERY_STRING']; $result = mysql_query("SELECT stateinfo FROM states WHERE stateid = '$stateid'") or die(mysql_error());
helloworld is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve products by groups i.e. by price range lordspace Coding Forum 2 12-30-2007 11:51 AM
Insert form results to a hidden field... malhyp Coding Forum 3 06-02-2006 09:10 AM
Directing specific users to a specific folder Kenny Fix Coding Forum 3 03-19-2006 08:57 AM
Google - seeing specific country only results pitpony SEO Forum 3 08-01-2005 09:55 AM
can't retrieve my password on hostdetective phosting Web Hosting Forum 2 06-21-2004 08:13 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 09:44 PM.
© Copyright 2008 V7 Inc