Re: Concept help required
| From: | George Pitcher | Date: | Thu, 10 Jan 2002 15:35:30 +0000 |
| Subject: | Re: Concept help required | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-15616@lists.php.net to get a copy of this message | ||
David,
> =there's a bunch of fast-mover jockies and helo boys who never have to pay
for their drinks when any of my guys
> are around...
>
Air Traffic Control was my area, though we did have to put up with some of
your lot when Ark Royal was in dock as we were a Buccaneer base.
>
> =Sorry, misunderstood the 'level' of your question/comment...
>
> =Yes you are correct, the SQL code 'resides'/is kept within the PHP code.
Borrowing an example (and editing a
> little) from Brian's post:
>
> $query = "SELECT Month, Score FROM scores WHERE Username = '$Username' " ;
> $result = mysql_query($query2)
> or die( "Cannot execute query" . mysql_error () ) ;
>
> =This is PHP code. The first line of which builds a SQL SELECT statement
where the contents of the PHP variable
> $Username will be substituted inside the single quotes, eg
>
> SELECT Month, Score FROM scores WHERE Username = 'George Pitcher'
>
> =The second line throws the query at MySQL and receives two results by
return. Firstly the logical: "did the
> call work or not?" which may fire the 'or' clause (returning an error msg
and number); and secondly the handle
> of the MySQL resultset. (the next step being to retrieve the actual data,
as required/appropriate from the
> resultset)
>
> =So at the code-level, the SQL commands/script is/are contained within the
.php page.
>
> =At the logic level, the functionality to retrieve only the single record
(that fulfills the stated criteria)
> from amongst all those in the database, is contained within the SQL
command.
>
> =but I'm still not sure which one is "wood", and which "trees"!
>
> =Ok now?
Yes, that clarifies a lot. I can stop looking for some place where it might
exist in MySQL and concentrate on the design until you are ready for the SQL
building. I think that some of my queries might be a bit of a challenge and
might require revisiting the design and data structure.
I'm not looking for anyone to solve my problems, just to help me along while
I learn the basics and then the tricks.
George
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com