php-general Digest 31 Aug 2011 11:39:27 -0000 Issue 7463

Topics (messages 314663 through 314668):

Re: Code should be selv-maintaining!
        314663 by: Jason Pruim
        314664 by: Matt Graham

scroll down list -visible, but not possible to choose
        314665 by: robert.myself.com
        314667 by: Lord_Farin .

mysqli sql question
        314666 by: Peet Grobler
        314668 by: John Black

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
On Aug 30, 2011, at 6:25 PM, Richard Quadling wrote:

> On 30 August 2011 20:09, Robert Cummings <[email protected]> wrote:
>> You're just saying that so Tedd will be your friend!! Come now, let's be
>> honest with everyone... Whitesmith's is UUUUUUUUHHHH-GLEE! ;)
> 
> Beauty is in the eye of the beholder.

I always thought that was beer holder?

Is it friday yet? ;)


Jason Pruim
[email protected]


--- End Message ---
--- Begin Message ---
From:  David Harkness <[email protected]>
> I don't always use braces, but when I do I use Compact Control Readability
> style. Stay coding, my friends.

...and when you use CCR style, you can sing, "I see a bad brace a-risin'"?

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


--- End Message ---
--- Begin Message ---
Hi,
 Got so excellent and fast help last time so trying again here

 I have the below function with array for satus of issues where I need to have 
'Resolved/Closed' visible but not available for choice
 This as closing is a separate function to ensure correct resolution code is 
selected 

Already tried removing 'Resolved', and got everything working only to notice 
when testing that when viewing issues the Resolved
 ones showed up as 'Support Working' even though closed in the system


 function print_statuses($selected) {
 $statuses = array('Resolved','Support Working','Waiting on 
Customer','New','Read Update');
 foreach($statuses as $status) {
 echo "<option value=\"$status\"";
 if($status == $selected) echo ' selected';
 echo ">$status</option>";
 }
 }

--- End Message ---
--- Begin Message ---
> Date: Wed, 31 Aug 2011 04:30:56 -0400
> From: [email protected]
> To: [email protected]
> Subject: [PHP] scroll down list -visible, but not possible to choose
> 
> Hi,
>  Got so excellent and fast help last time so trying again here
> 
>  I have the below function with array for satus of issues where I need to 
> have 'Resolved/Closed' visible but not available for choice
>  This as closing is a separate function to ensure correct resolution code is 
> selected 
> 
> Already tried removing 'Resolved', and got everything working only to notice 
> when testing that when viewing issues the Resolved
>  ones showed up as 'Support Working' even though closed in the system
> 
> 
>  function print_statuses($selected) {
>  $statuses = array('Resolved','Support Working','Waiting on 
> Customer','New','Read Update');
>  foreach($statuses as $status) {
>  echo "<option value=\"$status\"";
>  if($status == $selected) echo ' selected';
>  echo ">$status</option>";
>  }
>  }

The HTML attribute 'disabled' for the option tag might help you out here.
Another option would be to catch off selection of the 'Resolved' state when 
parsing the submission of the form.
Lastly you could alter the script to display something else instead of the 
selection box when the 'Resolved' state applies.

Personally I think the latter is the most elegant solution.

Regards,
Jasper
                                          

--- End Message ---
--- Begin Message ---
Is it possible to get the actual sql that is being used to query or
update the database?

E.g
$sth = $dbh->prepare ("update table set field=?, field2=? where id=?);
mysqli_bind_param ($sth, 'ssi', 'text1', 'text2', 10);
$sth->execute();

Something like $sth->sql? Or $dbh->sql?

I want to see "update table set field='text1', field2='text2' where id=10;


Thanks in advance,
Peet

--- End Message ---
--- Begin Message ---
On 31.08.2011 11:23, Peet Grobler wrote:
Is it possible to get the actual sql that is being used to query or
update the database?>
E.g
$sth = $dbh->prepare ("update table set field=?, field2=? where id=?);
mysqli_bind_param ($sth, 'ssi', 'text1', 'text2', 10);
$sth->execute();

Something like $sth->sql? Or $dbh->sql?
Thanks in advance,
Peet

Hi Peet,

not sure if there is a method to echo the sql but you can set your development MySQL server to log all queries to a log file. Use the log file with tail and you'll get a live view of all queries the server attempts to process.

Open my.cnf / my.ini and add the following line:
log= "/path/to/log/mysqld_query.log"
or
log="D:\logs\mysqld_query.log"

More info here: http://dev.mysql.com/doc/refman/5.1/en/query-log.html

I hope this helps ... ohh and don't forget to clear the log every now and then because it will get HUGE quickly.
--
John



--- End Message ---

Reply via email to