Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199807

RE: [PHP3] Many Selects on a page From: Brian Schaffner (BSchaffner <email protected>)
Date: 07/31/98

I'm not exactly sure what you're asking - but it sounds like you want to
pull a 1 record from each table you're selecting - is that correct? If
so, you can probably do a join of sorts:

        SELECT mytable1.myfield1, mytable2.myfield2, mytable3.myfield3
        FROM mytable1, mytable2, mytable3
        WHERE mytable1.myfield3='$someval' AND
mytable2.myfield4='$someotherval' AND
mytable2.myfield5=mytable3.myfield6;

It might help to give some more detail about your database design or the
type of queries you're making.

The dot (.) is the string concatenation operator:

        $newstring = $string1 . $string2;

You can also do something like this:

        $newstring = "string1$string2";

or even:

        $newstring = sprintf("%s%s", $string1, $string2);

The + operator is reserved for addition - and & is used to denote
passing a variable by reference rather than value.

Brian Schaffner, Manager of Internet Services
ACCENT Marketing Services, Inc.
 

> -----Original Message-----
> From: Alan Baer [mailto:abbaer <email protected>]
> Sent: Friday, July 31, 1998 2:17 PM
> To: php3 <email protected>
> Subject: [PHP3] Many Selects on a page
>
>
> I have a script that will make many (50-200) select
> statements per page
> generated. Each select is very simple, and they're all syntactically
> identical, but other than that have no relation to each other.
>
> Right now I'm looping through and doing 50-200 separate selects. That
> certainly isn't right. What's a better way to do it?
>
> Thanks!
>
> Alan Baer
> abbaer <email protected>
>
> P.S.: Basic question. I have two strings -- $string1 and $string2. How
> do I concatenate them? I don't see a relevant string function, and the
> traditional overloaded operators like + and & don't work.
>
> --
> PHP 3 Mailing List http://www.php.net/
> To unsubscribe send an empty message to php3-unsubscribe <email protected>
> To subscribe to the digest list: php3-digest-subscribe <email protected>
> For help: php3-help <email protected> Archive:
> http://www.php.net/mailsearch.php3
>
>

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3