Re: Take out one Data and show it in page
| From: | Johannes Janson | Date: | Thu, 29 Mar 2001 06:16:05 +0000 |
| Subject: | Re: Take out one Data and show it in page | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-7959@lists.php.net to get a copy of this message | ||
Hi,
hte first part after WHERE is the column name of your db.
if you want to search with name as a criteria you write:
selelct name, nickname from table where name=$name;
johannes
"Naga Sean" <nagasea@kaskus.com> schrieb im Newsbeitrag
news:20010329032314.0678136F9@sitemail.everyone.net...
> I had a question here.
> How to pull up one database, and then view that row
> what I mean here is
>
> NO NAME AGE
> 1 JOHN 12
> 2 RYAN 23
> 3 JIM 42
>
> I want to take JOHN out from database using URL
> www.example.com/template.php?name=JOHN
>
> here is my coding so far, and I know it's wrong, But will make you guys
had the idea what I want to do.
> Thanks
>
> -----------------------------------
>
> <?php
> $db = mysql_connect("localhost", "user","pass");
> mysql_select_db("media",$db);
> $result = mysql_query("SELECT nickname,name FROM database WHERE
$myrow[2]=$name",$db);
> $myrow = mysql_fetch_row($result);
> ?>
>
>
> Your name $myrow[name], $myrow[age]
>
> _____________________________________________________________
> www.kaskus.com - FREE EMAIL SERVICE
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>