Closed Thread Icon

Topic awaiting preservation: PLEASE HELP TO ACHIEVE THIS Pages that link to <a href="https://ozoneasylum.com/backlink?for=30492" title="Pages that link to Topic awaiting preservation: PLEASE HELP TO ACHIEVE THIS" rel="nofollow" >Topic awaiting preservation: PLEASE HELP TO ACHIEVE THIS\

 
Author Thread
seyz4all
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Aug 2008

posted posted 08-15-2008 11:53

this is the case scenario of what i want to achieve

the first textfield would accept the id

and the user would click on the search button,

and a form with 3 textfields is generated with the result of the search in the textfields,

that is textfield 1 would display the id
textfield 2 would display the name
textfield 3 would display the age

and then i can now click on a submit button to take the data into another table in that database

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 08-15-2008 13:52

what language are you using to do this? PHP? Python? Perl? ASP? Are you using a database? If so, which one? MySQL? SQL?

Did a pretty good job of saying what it is that you want to achieve but no mention of the tools being used

And welcome to the Asylum!

Later,

C:\

seyz4all
Obsessive-Compulsive (I) Inmate

From:
Insane since: Aug 2008

posted posted 08-15-2008 15:21

im using php and mysql db

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 08-15-2008 16:06

someone will be along to give you more (or better) help than I can, but...

The form just calls a search script right? say..."search.php" based on the text field the user entered.

So the form has a field called "id" and we need to run a SQL query to search the database for that id.

$findID = $POST['id']; or something of the nature will put the user entered info of the text field "id" into a variable to be used by PHP.

I like to change the case of the user input to lower case before sending the query on over.

code:
$findID = strtolower($findID);



Then we need to run the query:

code:
$data = mysql_query("SELECT *
FROM `myTABLE`
WHERE `myIDFIELD` LIKE CONVERT( _utf8 '%$findID%'
USING latin1 )
COLLATE latin1_swedish_ci
LIMIT 3 '");



Then we grab the results. I will say that in the results form, the text fields are called "resultID1", "resultID2" and "resultID3" :

code:
while($result = mysql_fetch_array( $data ))
{
  $resultID1 = $result[1];
  $resultID1 = $result[2];
  $resultID1 = $result[3];
}



I think that will work. I haven't tested it but...it might get you in the right track until someone else comes along to correct my sloppy code

Later,

C:\

seyz4all
Obsessive-Compulsive (I) Inmate

From:
Insane since: Aug 2008

posted posted 08-15-2008 18:40

thanks...i already worked it out

« BackwardsOnwards »

Show Forum Drop Down Menu