Page 1 of 1

Retrieve Databse from form using php

Posted: Sat Jul 25, 2009 4:10 am
by Shaiff
Hello There,

I m trying to Retrieve values from my database i,e "testshaiff" and the name of only table is "members". Finally i managed to retrieve values of the first row but the members table contain thousand of records and i need to search a particular value from search form (i,e members_id) and my script should work like; it search members_id value entered on form and match it will all members_id (in database) and then fetch complete row of that particular members_id. That shall be shown on the page.

Code is require to accomplish that task,

Thanks in advance.

Regards,
Shaiff

Re: Retrieve Databse from form using php

Posted: Sat Jul 25, 2009 5:44 am
by jackpf
You can use LIKE and % wildcards.

You can read about it here.

Re: Retrieve Databse from form using php

Posted: Sat Jul 25, 2009 2:10 pm
by califdon
Shaiff wrote:Code is require to accomplish that task,
Yes, indeed. So perhaps you need to learn how to write code, yes?

Re: Retrieve Databse from form using php

Posted: Sat Jul 25, 2009 2:16 pm
by jackpf
I like your signature :D

Cause of the mouse trap right?

Re: Retrieve Databse from form using php

Posted: Sat Jul 25, 2009 4:09 pm
by califdon
jackpf wrote:I like your signature :D

Cause of the mouse trap right?
You got it.

Re: Retrieve Databse from form using php

Posted: Sat Jul 25, 2009 6:11 pm
by Shaiff
i just need code to retrieve data of a particular row which is entered on search form.

other code is something like

<?php
require("db_config.php");
require("db_connect.php");
$sql = 'SELECT * FROM `members` ';
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
print "<br></br>". $row['m_id']. " ";
?>

I want to enhance that code to advance level.

Re: Retrieve Databse from form using php

Posted: Sat Jul 25, 2009 7:52 pm
by jackpf
jackpf wrote:You can use LIKE and % wildcards.

You can read about it here.
Do that then.

Re: Retrieve Databse from form using php

Posted: Sat Jul 25, 2009 8:50 pm
by califdon
Shaiff wrote:I want to enhance that code to advance level.
The reason you're not getting much help is that you haven't asked a specific question and it sounds like you think that you're going to learn programming by asking questions in this forum. You can't. You have to learn programming in a class, or from a book, or from online tutorials, then you have to try to use what you learned. THEN, when you have an error you don't understand or it isn't doing what you expected it to do, THAT's when you come here to a forum and ask for help. So far, you're just wasting our time. When you have tried to learn the basics and are struggling with a specific technical problem, we will be glad to help you.

Re: Retrieve Databse from form using php

Posted: Tue Jul 28, 2009 12:56 pm
by Shaiff
Mr califdon, as you said "you're just wasting our time"

So i won't bother you or your forum anymore.

Have Fun