Michael, unless I read this wrong what you are saying is, if the
director is working with more than one group you want a drop
down box so the director can choose which school they need
two work with on that screen. Right? Well, if that is so then, you
are right in using a drop down combo box. When you click
on school b in the box that would just initiate the query for
that school.
Wade
Michael Sullivan wrote:
>I'm working on a web interface for next year's music festivals at the
>college my wife and I attend. Basically, when a director registers
>their school, they are asked to put in various information about their
>school (school name, phone numbers, desired password, etc). All this
>information is stored in a mysql database. The director logs in with
>their email address and password and then are taken to a screen which
>show them the information they've already entered and allows them to
>create entries for the festival. My wife recently brought to my
>attention that some directors might be directing for more than one
>school. I was going to reorganize the info display page so that the
>director could choose which school they wanted to work with (probably by
>a school name in a combo box. The trouble is that in my PHP experience
>working with databases, there has never been more than one record I'd
>have to worry about. Here's a typical code snippet I use to retrieve
>data from the database:
>
> $query = "SELECT * FROM School WHERE
>email_address='$emailaddress'";
> $result = mysql_query($query, $link) or die("Could not find
>record.");
> $a_row = mysql_fetch_array($result);
> .
> .
> .
> $schoolid = $a_row[school_id];
> $schoolname = stripslashes($a_row['school_name']);
> $address = stripslashes($a_row['address']);
> $city = stripslashes($a_row['city']);
> $state = $a_row[state];
> $zip = $a_row[zip];
> .
> .
> .
>
>Etc, etc. But now that I might have two or more records for schools,
>how would I do that? I know I could make $a_row into an array (it
>practically is anyway), but how do I determine where one record stops
>another starts? Could I possibly use a foreach loop to loop through
>each of the records? The entire record could be called $a_row. I've
>done the foreach method before, except I've never done it with entire
>records - just individual fields within those records, such as
>
> $result = mysql_query("SELECT name FROM Accompanist where
>school_id='$schoolid' ORDER BY name ASC;") or die("Could not find
>record.");
> if (mysql_num_rows($result) > 0)
> {
> while($a_row = mysql_fetch_array($result, MYSQL_ASSOC))
> {
> foreach($a_row as $field)
> {
> print " <tr><td
>align='center'>$field</td></tr>\n";
> }
> }
> }
> else
> {
> print " <tr><td align='center'>None Entered
>Yet</td></tr>";
> }
>
>
>My other question is: Is it possible (with PHP) to determine if the
>browser has _javascript_ enabled before my web server sends the browser
>the web page? Above, I mentioned that I would like to use a combo box
>to allow them to select which school they wanted to work with. If the
>browser does not have _javascript_ enabled, I want to have PHP generate a
>Submit button for them to click....
>
>
>
>
>Community email addresses:
> Post message: php-list@yahoogroups.com
> Subscribe: [EMAIL PROTECTED]
> Unsubscribe: [EMAIL PROTECTED]
> List owner: [EMAIL PROTECTED]
>
>Shortcut URL to this page:
> http://groups.yahoo.com/group/php-list
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
[Non-text portions of this message have been removed]
Community email addresses:
Post message: php-list@yahoogroups.com
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
YAHOO! GROUPS LINKS
- Visit your group "php-list" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.