hi everybody... i ran across the site and found TONS of information about what i want to do.... but i don't know what to take for my need.
here is what i want to do... a search engine for my website through the database.
you can see what i have done for now at this url http://www.scale24-25.com/kitDB-site.php
this is the code
like you can see in my submit button i put a result.php file
it's this file i want to make but i'm stuck... really don't know how to make.
in fact you can make only 1 selection and press submit ex: you select the 1/24 scale and press submit it will return ALL kit in 1/24. If you select tamiya and honda it will return every kit honda made by tamiya etc...
also i want to see the kit number, the picture, year of production and of course the picture associate to this kit.
see below my field title of my database
kit_id = the ID of the kit 0, 1 , 2 ... auto increment
kit_number
description
manufacturer_ki t
manufacturer_re el
engine_detail
year_prod_kit
year_prod_reel
type
scale
image_id
so any help will be granted.
thank's in advance
sebastien
21 3172 Dormilich 8,658
Recognized Expert Moderator Expert @scaleautostyle
result.php has to do 4 main tasks - prepare the input for DB query
- query the DB
- prepare the DB results for display
- display the results
1.1) get the data from $_GET or $_POST (haven’t seen the opening <form>).
1.2) remove the unnecessary values
1.3) sanitize against SQL Injection. how you do that exactly depends on your DB system (Database Abstraction Layer, if you have one)
2) run the query
3) this again depends strongly on your DB system (results from a PDO based system differ quite much from a simple mysql_query())
4) print the values where you want them to be.
notes:
your file is neither valid XHTML nor is it ever treated as XHTML.
CSS helps you building cleaner and smaller HTML code.
thank you your answer Dormilich!!
about cleaning the file with CSS ... is what i,m doing right now... what you see at the moment is only for you helping me. this way you can see what i want to do.
Now time to jump in the CORE of the subject..
let me know what information you need to help me with the code for my result.php file.
i need to get any selection made the user in the dropdown and after that searchg the database for every matching item and after display the result.
can you gave me a hint of code that can do this. i'm using a normal mysql database nothing fancy.
this site is not for purchasing something. this is only a BIG library of everything made in 1/24 - 1/25 scale.
you can check the main page www.scale24-25.com i explain a bit more what it will do.
but for now i have to made some coding and it's whwere i have some problem
thank's in advance for your help
sebastien
Dormilich 8,658
Recognized Expert Moderator Expert @scaleautostyle
mainly how you want to do it, what you require, basic coding stuff.
first you need to decide, how you want to interact with your DB. from personal experience I can recommend a “Database Abstraction Layer”* (like PHP’s PDO and MySQLi classes). You should also consider using a “PHP framework”* (e.g. CodeIgniter), so you don’t have to code everything by yourself (and making DB queries is quite a common task). Once you decided about that we can talk about preparing data. @scaleautostyle
two possible routes are
1) fetching all the requested data and process that in a loop
2) fetching the matching DB keys and do fetch & display ** @scaleautostyle
I can give you an example of code I use, but that won’t help you much.
* google search term
** this can save considerable amount of code + way more flexible
thank's for the reply Dormilich!!
i just download CodeIgniter.. that's sound great for a beginner.. but i have a problem.. it's the first it's happen and i don't know what to do.
when i open the index.php file in my browser ( using my localhost) a pop-up appear to log in my localhost. it's asking my username and password.. what's this???
also i will do what you think it will be the best for the purpose of the site i'm building. do you see the update page www.scale24-25.com/kitDB-site.php it's a bit better,
so let me know about the popup login i got and by what you want to start.
i will e a VERY GOOD student sir. promise.
thank's
sebastien
Dormilich 8,658
Recognized Expert Moderator Expert @scaleautostyle
beats me why… no idea. check your server directory for a .htaccess file (this is used on apache for a login pop-up). on all posix os this is a hidden file! @scaleautostyle
it’s not about what I think… it looks way better now :)
well, as for the HTML, get rid of the table, it’s not necessary.
and drop XHTML, if you don’t want to use the possibilities of using XML
WOU ouuu... it's working... i found the .htaccess file and delete it... now it's working..
what do you mean by rid the XHTML... i wrote my code using adobe dreamweaver selecting new PHP and open. i don't use XHTML
what do you mean by this??
well, as for the HTML, get rid of the table, it’s not necessary.
do you mean to use CSS instead of what i use??
and now i'm ready to sstrat... hum hum.. by what we begin proffessor??
thank's
sebastien
Dormilich 8,658
Recognized Expert Moderator Expert @scaleautostyle
you (Dreamweaver resp.) use a XHTML 1.0 DTD… use this instead - <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
-
"http://www.w3.org/TR/html4/strict.dtd">
@scaleautostyle
CSS is a layout language. so if you have semantic (structural) html code, you can use CSS to make it look like you want it. (see CSS Zen Garden, always the same HTML, but each CSS brings a totally new appearance)
ex. full code - <ol id="all_params">
-
<li>
-
<label for="limit_l">Intervall von:</label>
-
<input id="limit_l" type="text" size="20" value="0" />
-
</li>
-
<li>
-
<label for="limit_r">Intervall bis: </label>
-
<input id="limit_r" type="text" size="20" value="1" />
-
</li>
-
</ol>
- ol {
-
list-style-type: none;
-
}
-
-
li label {
-
float: left;
-
width: 10em;
-
text-align: right;
-
padding-right: 0.5em;
-
}
-
-
li {
-
clear: both;
-
padding-top: 0.5em;
-
}
thank's for the hint about the xhtml.. i will change all my file.
for the CSS i'm working on that already. when it will be finish i will let you know.
and now about my initial problem... the sql query neede to my search option...
by what i start ( or by what we start proffessor )
yours
sebastien
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: minchu |
last post by:
Hello,
I have used CSS in HTML page (font-verdana size-8pt), looks fine in
windows but in linux the fonts are corrupt and its too small. Kindly
help me and tell what is the solution to correct this.
www.teledna.com
Regards,
Minchu
|
by: Alec |
last post by:
First attempt at doing an exercise on paginating result sets
When I run the code, I receive the error "Fatal error: Call to
undefined function: mysql_fetch_objects() in
/homepages/17/d23395818/htdocs/en/test.php on line 48"
Line 48 is while($row = mysql_fetch_objects($result)) Any ideas?? Have
I missed an obvious mistake. (full code below)
Many thanks
|
by: assgar |
last post by:
Hi
Developemnt on win2003 server. Final server will be linux
Apache,Mysql and PHP is being used.
I use 2 scripts(form and process).
The form displays multiple dynamic rows with chechboxs, input box for units of service, description of the service and each row has its own dropdown list of unit fees that apply.
Each dynamically created row will return 3 values fee1_choice, fee1_unit and fee1_money.
Note The above informaton is...
|
by: peridian |
last post by:
Hi,
I wanted a web page where I could post code to, and have it appear in coloured formatting based on the context of the code.
Most of the techniques I have seen for this involve complex use of string manipulation where they seek through the string back and forth doing replacements to substitute in the needed HTML code.
I am convinced that this can be done with a few regular expressions. Unfortunately my knowledge of regular...
|
by: assgar |
last post by:
Hi
Multiple rows of dynamically created data is retrived from the database and displayed properly.
When I get 50 rows displayed scrolling is necessary.
The problem is when I scroll to see the items at the bottom of the list the rows get blurred (jumbled).
To be specific at the top and bottom rows of the list are displayed properly but in the middle the rows get blurred.
Can you you see something wrong with my code? How can I make...
| |
by: WiseG1rly |
last post by:
Hey everyone!
I am completley new and I will start off by saying that I am not a programmer - figuring out this search took so long! I am debugging now and would appreciate any help :)
Anyways, I am creating a website where I have a database of pet listings in california. Each record lists the Type of Listing (eg. dog grooming or vet) the the Area it is in (so state, county etc.), a Name, Description, and Address.
I created a search...
|
by: jasone |
last post by:
Hi all, ive got a search function running on a database, the action performed by the form is shown below, within the 'else' statement i would like to show roughly 5 random rows from the sql table (alternative products) if you like.
please find below the script im currently running for the search, the else statment just shows 'no results found' message at the moment.
many thanks in advance for any who can help:
<table width="40%"...
|
by: howzy |
last post by:
Hello I am new to the database world and Ive learned how to do a few things storing text is easy. i found that out but trying to get an image to show up on a page is difficult and i cant seem to find the correct way to call it up in php so it will display..What i am trying to do is build a search engine for a furniture companys rug collection...so that the rug type style size and an image next to that will show up...
this is my php code...
|
by: agarwalsrushti |
last post by:
Hi,
Im just stuck up with a small query. In my database ive a table called specialization which is dependent on qualification. In specialization i ve 3 fields: QualificationId, SpecializationId,SpecializtionArea. in specialization table there are SpecializationArea with same name but with diferent SpecializationId and QualificationId. Now when i enter search page and select to search based on specialization then it doesnt displays the results...
|
by: angelicdevil |
last post by:
i have listbox 1 which displays status , based on selection of status listbox 2 displays usernames. and based on username selected the textbox displays the email id.
its working fine till displaying user names in listbox 2 based on selected of status in listbox. but its not displaying the emailid based on selection of usernames and when i click on search for users button its refreshs the page and shows the intial page also want the text box...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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...
| |