php-general Digest 9 Sep 2012 03:19:51 -0000 Issue 7956

Topics (messages 319015 through 319023):

Re: The end of "mysql"
        319015 by: Bastien
        319016 by: Jim Giner
        319017 by: Jim Giner
        319019 by: Daniel Brown
        319020 by: Paul M Foster
        319022 by: Daniel Brown

Re: a little trickery
        319018 by: Stuart Dallas
        319021 by: Daniel Brown
        319023 by: David McGlone

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---

Bastien Koert

On 2012-09-08, at 9:54 AM, Jim Giner <jim.gi...@albanyhandball.com> wrote:

> Nope. No PDO as yet either
> 
> jg
> 
> 
> On Sep 7, 2012, at 11:22 PM, Adam Richardson <simples...@gmail.com> wrote:
> 
>> On Fri, Sep 7, 2012 at 9:58 PM, Jim Giner <jim.gi...@albanyhandball.com> 
>> wrote:
>>> So with the announced end of the mysql functions (and switching to a
>>> different extension), one would think that my isp/hoster would be a bit more
>>> interested in my dilemma.  I tried today to create my first mysqli-based
>>> test script and found that I didn't have that extension.  A series of emails
>>> with my tech support told me that the shared server farm does not get
>>> "mysqli" - only their business servers.  Since I dont' have a need for and
>>> want to pay more for a 'business server', I'm told I'm s... outta luck.
>> 
>> What about PDO? Is that available?
>> 
>> Adam
>> 
>> -- 
>> Nephtali:  A simple, flexible, fast, and security-focused PHP framework
>> http://nephtaliproject.com
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

Change hosts. They are not keeping up

--- End Message ---
--- Begin Message ---

On 9/8/2012 10:40 AM, Bastien wrote:

Change hosts. They are not keeping up
That's not entirely true. They have kept up to date with most things for the 10 years I've been with them. I think they just have to get their heads around the idea that the PHP community is moving ahead on something and they'll come around.

Plus - I've just found that they do have PDO_mysql extension.

--- End Message ---
--- Begin Message ---
On 9/8/2012 9:54 AM, Jim Giner wrote:
Nope. No PDO as yet either

jg


On Sep 7, 2012, at 11:22 PM, Adam Richardson <simples...@gmail.com> wrote:

On Fri, Sep 7, 2012 at 9:58 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
So with the announced end of the mysql functions (and switching to a
different extension), one would think that my isp/hoster would be a bit more
interested in my dilemma.  I tried today to create my first mysqli-based
test script and found that I didn't have that extension.  A series of emails
with my tech support told me that the shared server farm does not get
"mysqli" - only their business servers.  Since I dont' have a need for and
want to pay more for a 'business server', I'm told I'm s... outta luck.

What about PDO? Is that available?

Adam

--
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Actually - I was incorrect. A quick run of "get_loaded_extensions" reveals that my hoster does provide something named: pdo_mysql as the very last item. Guess I'll have to go with that ext rather than mysqli.
--- End Message ---
--- Begin Message ---
On Fri, Sep 7, 2012 at 9:58 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
> So with the announced end of the mysql functions (and switching to a
> different extension), one would think that my isp/hoster would be a bit more
> interested in my dilemma.  I tried today to create my first mysqli-based
> test script and found that I didn't have that extension.  A series of emails
> with my tech support told me that the shared server farm does not get
> "mysqli" - only their business servers.  Since I dont' have a need for and
> want to pay more for a 'business server', I'm told I'm s... outta luck.
>
> Any idea on the approximate date when mysql truly goes away - ie, when is
> the proposed (next) update that will completely refuse to recognize it?
> Might be ammunition for me.

    There is no date yet, but I can say that just today the first
serious discussion regarding the first release of the PHP 5.5 branch
occurred, with a (very) preliminary target date of February or March
of 2013.  It's far more likely to see such a major BC change in at
least a new minor branch.  As for that happening in either the 5.4 or
5.3 series, I wouldn't consider that a serious possibility by any
means.

    As for your hosting provider, it baffles me why they wouldn't
support MySQLi, but a quick evaluation shows they still use old
versions of Apache and OpenSSL, and are still using unpatched versions
of PHP 5.2 in production.  That said, they might keep their
non-business support to a bare minimum to help control cost, though it
does sacrifice some security and functionality.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On Fri, Sep 07, 2012 at 09:58:38PM -0400, Jim Giner wrote:

> So with the announced end of the mysql functions (and switching to a
> different extension), one would think that my isp/hoster would be a
> bit more interested in my dilemma.  I tried today to create my first
> mysqli-based test script and found that I didn't have that
> extension.  A series of emails with my tech support told me that the
> shared server farm does not get "mysqli" - only their business
> servers.  Since I dont' have a need for and want to pay more for a
> 'business server', I'm told I'm s... outta luck.
> 
> Any idea on the approximate date when mysql truly goes away - ie,
> when is the proposed (next) update that will completely refuse to
> recognize it?  Might be ammunition for me.

Please excuse my ignorance. I feel like I just stepped into the middle
of a conversation. What's this about "announced end of the mysql
functions"? Who exactly announced what, and is there a link to whatever
announcement somewhere?

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

--- End Message ---
--- Begin Message ---
On Sat, Sep 8, 2012 at 11:40 AM, Paul M Foster <pa...@quillandmouse.com> wrote:
>
> Please excuse my ignorance. I feel like I just stepped into the middle
> of a conversation. What's this about "announced end of the mysql
> functions"? Who exactly announced what, and is there a link to whatever
> announcement somewhere?

    Right now, it's an extended soft deprecation.  It's been discussed
since 2010.  You can find a direct link from June here:

        https://bugs.php.net/bug.php?id=62213

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On 8 Sep 2012, at 15:35, David McGlone <da...@dmcentral.net> wrote:

> I have a function that reads a directory and gets all the file names of 
> images, 
> and I am wondering if it's possible to concatinate this function withint an 
> image tag. Here's an example I tried.
> 
> function pictures() {
> 
>    $dir = 'images/property_pics/';
>    $file = array();
>      if(is_dir($dir)){
>       if($open = opendir($dir)){
>         
>         while (($file = readdir($open)) !== false && $file !== ".") {
>             
>       $names = substr($file, 9, 20);
>       echo $names;
> 
>       }
> 
>       }
>      closedir($handle);
>    }
> } 
> 
> $rs = $pager->paginate();
>  if(!$rs) die(mysql_error());
>  while($row = mysql_fetch_assoc($rs)) {
> 
> 
>    echo "<div id='record'>";
>    echo "<span>";
>    echo <im src = "images/$row[$MSL_No]pictures();">
> 
> What I am trying to do is get the last part of an image name, because I know 
> the $MSL_No is always a 9 character name which matches the image name in 
> but in the database, the last bit of characters are not there so I'm trying 
> to 
> take the last characters of the image name and concatinate them to each 
> image name..
> 
> Wow this is harder to explain that I thought. Here's an example
> 
> In the DB I have a row MSL_No and the contents is: 123456789
> 
> In my images folder I have an image named 123456789_R13_1.jpg
> 
> My goal: get the MSL_No out of the DB and concatenate anything after it so I 
> would end up with the whole image name..
> 
> I hope this all made sense. :-/

Is there just one image in the folder that starts with the 9 digit number? In 
that case it's dead simple (untested code):

<?php
  function completeImageFilename($prefix)
  {
    $matches = glob('images/property_pics/'.$prefix.'*');
    return $matches[0];
  }

  echo '<img src="'.completeImageFilename($row['MSL_No']).'" />';
?>

If you need to extract more than one image filename you should be able to 
modify that pretty easily.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

--- End Message ---
--- Begin Message ---
On Sat, Sep 8, 2012 at 10:49 AM, Stuart Dallas <stu...@3ft9.com> wrote:
>
> Is there just one image in the folder that starts with the 9 digit number? In 
> that case it's dead simple (untested code):
>
> <?php
>   function completeImageFilename($prefix)
>   {
>     $matches = glob('images/property_pics/'.$prefix.'*');
>     return $matches[0];
>   }
>
>   echo '<img src="'.completeImageFilename($row['MSL_No']).'" />';
> ?>

    Stuart is, as usual, right on.  Rather than do the filesystem
handlers and loops, you should definitely consider glob().  Not only
is it quicker, cleaner, and easier to use, but it's far less
resource-intensive than your current implementation.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On Saturday, September 08, 2012 03:49:27 PM you wrote:
> On 8 Sep 2012, at 15:35, David McGlone <da...@dmcentral.net> wrote:
> > I have a function that reads a directory and gets all the file names of
> > images, and I am wondering if it's possible to concatinate this function
> > withint an image tag. Here's an example I tried.
> > 
> > function pictures() {
> > 
> >    $dir = 'images/property_pics/';
> >    $file = array();
> >    
> >      if(is_dir($dir)){
> >     
> >     if($open = opendir($dir)){
> >     
> >       while (($file = readdir($open)) !== false && $file !== ".") {
> >     
> >     $names = substr($file, 9, 20);
> >     echo $names;
> >     
> >     }
> >     
> >     }
> >     
> >      closedir($handle);
> >    
> >    }
> > 
> > }
> > 
> > $rs = $pager->paginate();
> > 
> >  if(!$rs) die(mysql_error());
> >  while($row = mysql_fetch_assoc($rs)) {
> >  
> >    echo "<div id='record'>";
> >    echo "<span>";
> >    echo <im src = "images/$row[$MSL_No]pictures();">
> > 
> > What I am trying to do is get the last part of an image name, because I
> > know the $MSL_No is always a 9 character name which matches the image
> > name in but in the database, the last bit of characters are not there so
> > I'm trying to take the last characters of the image name and concatinate
> > them to each image name..
> > 
> > Wow this is harder to explain that I thought. Here's an example
> > 
> > In the DB I have a row MSL_No and the contents is: 123456789
> > 
> > In my images folder I have an image named 123456789_R13_1.jpg
> > 
> > My goal: get the MSL_No out of the DB and concatenate anything after it 
so
> > I would end up with the whole image name..
> > 
> > I hope this all made sense. :-/
> 
> Is there just one image in the folder that starts with the 9 digit number?
> In that case it's dead simple (untested code):
> 
> <?php
>   function completeImageFilename($prefix)
>   {
>     $matches = glob('images/property_pics/'.$prefix.'*');
>     return $matches[0];
>   }
> 
>   echo '<img src="'.completeImageFilename($row['MSL_No']).'" />';
> ?>
> 
> If you need to extract more than one image filename you should be able to
> modify that pretty easily.

YEOW! LOL I looked at this and I'm very stumped on 1 thing. How in the world 
did you get $prefix to contain the image name without first assigning it to 
$prefix? I understand the rest, but..... Holy smokes, that's blown my mind. :-/

-- 
Regards
David M.

--- End Message ---

Reply via email to