To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Newbies

Newbies Help for those who are just getting started

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-13-2005, 02:22 AM   #1
TVining
Junior Member
 
Join Date: Nov 2005
Posts: 3
Question Sending form to the database

Sorry, but I don't have a lot of web script experience. I am a database guy, and haven't worked much with PHP.

I have a database containing some basic fields. These include: Sq, Dorm, Unit, Address and Zip.

When I use a web form to submit Sq and Dorm, I want to return the full record; Sq, Dorm, Unit, Address and Zip.

How do I use the form to send the request to the PHP database on MySQL?

What code do I put in the page?
TVining is offline   Reply With Quote
Old 11-13-2005, 02:54 AM   #2
Rwap
PHP Idiot
 
Join Date: Nov 2005
Location: NC
Posts: 9
<?php

(connection stuff up here)


$sql=" select * from YOUR_TABLE order by WHAT_EVER desc ";

$rs = mysql_query($sql) or die(mysql_error());


while ( $row = mysql_fetch_assoc( $rs) )
{
echo '<center>
'.$row["Sq"].' || By:'.$row["Dorm"].' <br>
'.$row["Unit"].' || '.$row["Address"].' || '.$row["Zip"].'
<HR>
</center>';


?>


^
|
|
|

That should do nicely
Rwap is offline   Reply With Quote
Old 02-14-2006, 10:52 AM   #3
TVining
Junior Member
 
Join Date: Nov 2005
Posts: 3
Thanks for the help.

I ended up using a little different route, but based from the same script.

Here's the app: http://address.f-16.org
TVining is offline   Reply With Quote
Old 02-14-2006, 12:05 PM   #4
codefetch
Junior Member
 
Join Date: Feb 2006
Location: Portland, Oregon
Posts: 3
full example

A codefetch search for connect form database select found this short but complete example to display a form and retrieve database results based on it from the book Beginning PHP 5 and MySQL: From Novice to Professional.
codefetch is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 12:01 PM.






Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.