Current location: Hot Scripts Forums » Programming Languages » PHP » Website Capability search? Php & MySQL?


Website Capability search? Php & MySQL?

Reply
  #1 (permalink)  
Old 12-13-04, 05:14 AM
bookemdanno bookemdanno is offline
New Member
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Question Website Capability search? Php & MySQL?



Hi I'm new, excuse me if i sound stupid, but i am being asked to produce a capability search for a website. I am a designer, not a programmer, therefore I Know nothing of this, and i'm trying to accomplish what has been thrown at me.

With Php been used more widely would Php and MySQL be best to produce this search or should i use others?

The Part number needs to be entered into the search, which if correct will display the: part no./description/price

If the number doesn't exist, then an out of stock text needs to appear.

Any help, or advice would be greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old 12-13-04, 06:13 AM
greybird greybird is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Assuming that you have a database with all the part numbers entered into it then it is a very easy task, you just need to connect to the database and then send a query to look for that part number:

PHP Code:

$db mysql_connect('localhost''user''password');

mysql_select_db('database_name'$db);

//we have used a form to submit the data using the POST method
$part_num = (int)$_POST['part_number']; //makes sure its an int
$result mysql_query("SELECT * FROM parts WHERE number = '$part_num'");
if(
mysql_num_rows($result)){
   
//display results
}else{
   
//show error message - no results found

If the part numbers arent already in the database then it might be slightly harder to do.

Hope that helps.
Reply With Quote
  #3 (permalink)  
Old 12-13-04, 06:50 AM
bookemdanno bookemdanno is offline
New Member
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Wink

Thanks for the reply.

The database fields are below.

Part Number / Description / Manufacturer / End Unit P/N

1326917 / Field Assy / Bendix / 30E02

1531445 / Main Stator Assy / Allied Signal / 28B141

Thanks for your help, hopefully i'll be on the right track. I just had this thrown at me, and i'm expected to have it done asap. Bosses who just don't understand things.
Reply With Quote
Reply

Bookmarks


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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
SEO Expert Available nakulgoyal Job Offers & Assistance 2 08-14-04 12:38 PM
FS: Prozilla Memberships (Turnkey Sites) - $10-15 less than Retail! rockergrrl General Advertisements 0 08-11-04 12:05 AM
another php search mysql problem sumogray PHP 6 06-28-04 08:03 AM
How to create a php mysql site searchable from search engines? Klesti PHP 2 05-16-04 04:09 PM


All times are GMT -5. The time now is 05:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.