Re: selecting a specific record from database
| From: | Doug Semig | Date: | Sat, 18 Nov 2000 00:32:21 +0000 |
| Subject: | Re: selecting a specific record from database | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-4528@lists.php.net to get a copy of this message | ||
There are tutorials you might want to check out. You can go to
http://www.php.net/links.php and look in the list of
links. I recommend
phpwizard and phpbuilder. Of course, there's
http://www.php.net/manual/ref.mysql.php as
well.
I will try to address your questions below...but the answers will be pretty
general. There's nothing like trying (and failing and trying again!).
Hope this helps lead you in the right general direction...
Doug
At 06:47 PM 11/17/00 -0500, JMO wrote:
>I need to create a table in which different user's data (it's an
>application) will be stored. One record line for each user, calling and
>inserting to be based on a single username.
>
>My question is this: How do you select a specific record of data from a
>table, and then call the data from that record alone.
With an SQL statement: "SELECT columnlist FROM table WHERE primarykeyfield
LIKE 'username'", replacing columnlist, table, primarykeyfield, and
username with the appropriate names and value. You pass the SQL statement
to MySQL with the mysql_query() PHP function. Then if mysql_num_rows() PHP
function returns a value of 1 (one) then you successfully retrieved the row
you wanted. You get the values with the mysql_fetch_row() PHP function.
>Additionally, how to enter the data into that table record.
With an SQL statement: "INSERT INTO table (columnlist) VALUES (valuelist)",
replacing table, columnlist, and valuelist with appropriate names and
values. You pass the SQL statement to MySQL with the mysql_query() PHP
function.
>
>I am new to PHP/mySQL interactions, and I appreciate your help. Please
>reply to jeof@jeof.net if you can. Thank you!
Ok...sent to the list and to that address as well, breaking my own rule of
"you asked here, you can look for an answer here" because you asked nicely.
>
>Jeof Oyster
>Top Flight Leadership
>