Re: does this work?

From: Date: Thu, 10 Jan 2002 21:41:34 +0000
Subject: Re: does this work?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-80097@lists.php.net to get a copy of this message
I think it will really help if you post more of your code. It is obvious that the parse error is not contained within the lines of code that you pasted :) I think more of your code will reveal the answer rather quickly :) HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 X289 smasiello@synacor.com ----- Original Message ----- From: "Erik Price" <pricee@hhbrown.com> To: "Kevin Stone" <kevin@helpelf.com> Cc: "PHP (E-mail)" <php-general@lists.php.net> Sent: Thursday, January 10, 2002 4:43 PM Subject: Re: [PHP] does this work? > I tried that... I get the same error (same line and everything). > As a side note, I haven't ever had to quote the first argument in > mysql_query() before... > This is quite a conundrum, eh? > > > Erik > > > On Friday, January 11, 2002, at 04:25 AM, Kevin Stone wrote: > > > Hmm I believe that the mysql_query() function requires quotes around the > > query statement even it it is being passed as a variable.. > > > > mysql_query("$tempsql", $db); > > > > -Kevin > > > >> 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: php-general-unsubscribe@lists.php.net > >> For additional commands, e-mail: php-general-help@lists.php.net > >> To contact the list administrators, e-mail: php-list- > >> admin@lists.php.net > >> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#80097) next »