Jump to content


Photo

~~mysql -->(form+serach) ...help me~~


  • Please log in to reply
4 replies to this topic

#1 ahmed17

ahmed17
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 07 September 2006 - 07:59 PM

hello , i  am beginner with php and mysql  and i wnat any one help me  to  do the following :
i want to create database for example  take name and age from user
and make aform which enable user to make search if he need to know any thing
and print result in page ....
:)

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 07 September 2006 - 08:08 PM

I'm not exactly what application this is for, but there are plenty of tutorials that covers the basics of PHP/MySQL. 
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 07 September 2006 - 08:43 PM

I'm not exactly what application this is for, but there are plenty of tutorials that covers the basics of PHP/MySQL. 


i'll second that. you're really asking about several different things here, and the majority of what you're asking would be best answered in the PHP forum. you should break down what you're after into bite-sized pieces and try to get answers to them a piece at a time.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#4 ahmed17

ahmed17
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 08 September 2006 - 11:20 AM

what i mean if i have samll database how i tie it with form to search via it to database
for example textbox tie with db and print result in page .............

#5 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 08 September 2006 - 12:26 PM

ok, i'll bite. i'll help you with one piece of the puzzle: the query. if you have a variable that contains the search text, you've got to determine which field(s) you're going to run your match on and then simply use the LIKE comparison to see if you have a match:
SELECT * FROM tableName WHERE myCol LIKE '%$searchString%';

when you run a LIKE with the '%' delimiters, you will return every record where "myCol" column contains the search string somewhere inside it.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users