Yes, the semi-colon is the command separator. Try it and echo $tempsql.

Miles Thompson

At 09:16 AM 1/11/2002 +1100, Martin Towell wrote:
>is this valid in PHP?? (haven't tried it myself yet...)
>
>$tempsql = "SELECT COUNT(*) AS count
>                         FROM divisions";
>
>maybe it needs to be on one line???
>
>
>-----Original Message-----
>From: Rick Emery [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 11, 2002 8:39 AM
>To: 'Erik Price'; PHP
>Subject: RE: [PHP] does this work?
>
>
>Show all your code.  Did you open a connection to the MYSQL server?  If so,
>show the code.
>
>-----Original Message-----
>From: Erik Price [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 10, 2002 3:29 PM
>To: PHP
>Subject: [PHP] does this work?
>
>
>It seems that I have a "parse error" somewhere in the following code
>(since that's the only code in my script, it's a test script):
>
>// arraytest.php
>$tempsql = "SELECT COUNT(*) AS count
>                         FROM divisions";
>$tempresult = mysql_query($tempsql, $db);
>$temprow = mysql_fetch_array($tempresult);
>
>echo $temprow["count"];
>
>
>Yet, it works fine in the mysql client.  Thus, I am led to believe that
>PHP is not capable of constructing the same kinds of SQL statements that
>can be constructed in the mysql client.  Is this the case?
>
>
>Erik
>
>
>PS: what I am -really- trying to do is dynamically fill in a <select>
>listbox with <options> that correspond to all of the records in a given
>table.  Like so:
>
><form>
>       <select>
>            <?php
>            foreach
>($record_id_and_record_name_pair_pulled_from_mysql_query) {
>                print("<option
>value=\"${record_id}\">${record_name}</option>");
>            }
>            ?>
>        </select>
></form>
>
>but I am unsure of how to grab multiple values from the mysql_query()
>and load them into an array.  Has anyone done this before?
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to