473,770 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Newbie needs advice on query search

2 New Member
Hi, all of you! I am new to this community. I am a web designer and a friend of mine and I have a server and manage websites (mostly ours but also a few clients). I manage the sites and he does the database management. My friend, an expert at javascript and java programming, is burning out on programming and he doesn't want to do it anymore. I'm stuck, on my own.

So ... now I have to learn PHP (can't use CGI) and database management. I have no problem accessing the database and managing records, and I have no problem connecting to the database with scripts, but I am just learning how to query and return results.

I have been pulling my hair out for a week trying to figure out the following:

I have three independent searches on one page. Each search will call a separate page (I think). On this same page, there are two text searches. I need to be able to have success at the simplest text search first before I can move on to the other text search and the drop down menu search.

My first query needs to result in three fields being extracted from the database table. In this case it is town, number, and sub_number. The results need to return on a page in rows (unlimited) but each hyperlinked. These hyperlinks will be links to internal HTML pages. That's it. I just need to know the proper query syntax and code. If I can make this work, then I will have a better understanding about how to progress further, especially trying to succeed with three searches from one page. Many thanks to anyone who can help me.
Nov 10 '06 #1
2 1439
exoskeleton
104 New Member
hi sir, i will try to help ...here's the logic...

page1.html:
[HTML]
<form name="form1" method="post" action="page2.p hp">

firstname: <input name="firstname " type="text" id="firstname" >
lastname: <input name="lastname" type="text" id="lastname">
<input type="submit" name="Submit" value="Submit">
</form>
[/HTML]

page2.php
[PHP]
// database connection
// codes here........... .
// getting the entry from page1
if (isset($_POST['Submit'])) {

$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];

$SQL="SELECT * FROM tbl_name WHERE column_uname = '$firstname' AND column_lname = '$lastname'";

$Execute = @mysql_query($S QL) or die(@mysql_erro r());

while ($field = @mysql_fetch_ar ray($Execute)) {

// assigning value to variable from the result
$firstname = $field['column_uname'];
$lastname = $field['column_lname'];

// output the result
echo $firstname;
echo $lastname;
// break
echo "<br />";

} // End while
} // End if

[/PHP]

Hope it helps a little sir...Good Luck!!!
More power...
Nov 11 '06 #2
Paul Revere
2 New Member
Dear exoskeleton,

Thank you very much! I spent a week looking for this, and even paid a few dollars for help at Experts Exchange, but it was like pulling teeth to get my "Expert" to give me some proper code. Great job! Thanks a mil!

Paul Revere
Nov 15 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

14
4633
by: vic | last post by:
My manager wants me to develop a search program, that would work like they have it at edorado.com. She made up her requirements after having compared how search works at different websites, like eBay, Yahoo and others. This is what she wants my program to be able to do: (try this test at different websites just for fun). At eBay: - enter the word 'television' in a search field à you will get 2155 items.
32
2584
by: Alan Silver | last post by:
Hello, I shamefully admit to be an old web designer, from before the days of CSS. In those heady days, tables were king and were used for every possible kind of alignment. When CSS came along, it was useful for specifying colours and fonts for a site in one central location, but useless for any real kind of design work due to the poor browser support. I got well in to using CSS for colours and fonts, but carried on using tables for...
4
1241
by: areese801 | last post by:
i am using a website with a form that passes criteria to a javascript to run a query rather than just appending my criteria to parts of the URL. i need to import a bunch of records into MS access from this site. this would be very easy to do if i could just change part of the url and programatically navigate there. unfortunatly this javascript is doing all of the querying. is there a good place to start to be able to get around this?
6
1706
by: jim | last post by:
Is anyone able to provide me with a link to useful documentation or just outright explain to me how to set query parameters dynamically? I'm really new to Access and databases in general but I suspect that there is a way to insert criteria into a query besides opening it up and typing "and" and "or" on the criteria row of each column. I have a query that shows thousands of records (students in different classes taking different tests)...
53
4757
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code, and .Net2005 code. I'm developing in vb.net 2005. This test sub just reads an input text file, writing out records to another text file, eliminating records that have a '99' in them (it is similar to a CSV file). Some of my concerns are:
2
1109
by: gozu | last post by:
Here is my query: SELECT departments.department_name AS "Department name", locations.STREET_ADDRESS AS "Mailing address", locations.city, locations.state_province, locations.postal_code FROM departments, locations WHERE departments.location_id = locations.location_id AND locations.country_id = 'US' ORDER BY department_name; and here is what the output is like:
0
1143
by: deeak | last post by:
Hi All, I have set of strings in the db2 table and two range keys to search. I have to finds strings the table which would be in between the range of keys defined. Strings in the colum to search (COLUMN_TO_SEARCH) : KAVICEH&,KAVICEH>,K$VICEH&,KAVICEH$ Range of keys defined : KAVIC$$$ , KAVIC$$/ SQL query may looks like :
0
956
by: Rauf Sarwar | last post by:
Originally posted by dreimer You have to use ODBC/ADO etc to connect to the database. I don't know the exact syntax but you can search in comp.lang.visual.basic NG. Another suggestion.... dump VB script/ASP and go with Java. Regards /Rauf Sarwar
5
2155
by: SharkD | last post by:
Hi! I'm a total newbie when it comes to ASP (or any type of server-side programming). I want to start a project that does the following: 1. query Wikipedia for information regarding articles using the
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.