Retrieve Databse from form using php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Shaiff
Forum Newbie
Posts: 3
Joined: Sat Jul 25, 2009 3:55 am

Retrieve Databse from form using php

Post 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
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Retrieve Databse from form using php

Post by jackpf »

You can use LIKE and % wildcards.

You can read about it here.
Last edited by jackpf on Sat Jul 25, 2009 7:52 pm, edited 2 times in total.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Retrieve Databse from form using php

Post by califdon »

Shaiff wrote:Code is require to accomplish that task,
Yes, indeed. So perhaps you need to learn how to write code, yes?
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Retrieve Databse from form using php

Post by jackpf »

I like your signature :D

Cause of the mouse trap right?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Retrieve Databse from form using php

Post by califdon »

jackpf wrote:I like your signature :D

Cause of the mouse trap right?
You got it.
Shaiff
Forum Newbie
Posts: 3
Joined: Sat Jul 25, 2009 3:55 am

Re: Retrieve Databse from form using php

Post 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.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Retrieve Databse from form using php

Post by jackpf »

jackpf wrote:You can use LIKE and % wildcards.

You can read about it here.
Do that then.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Retrieve Databse from form using php

Post 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.
Shaiff
Forum Newbie
Posts: 3
Joined: Sat Jul 25, 2009 3:55 am

Re: Retrieve Databse from form using php

Post 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
Post Reply