php-general Digest 6 Nov 2006 07:12:14 -0000 Issue 4443

Topics (messages 244240 through 244248):

Re: Sorting MySQL queries
        244240 by: Roman Neuhauser
        244248 by: clive

imageloadfont
        244241 by: Ron Piggott (PHP)

Re: Issue when inserting Slovak characters in database via PHP code
        244242 by: M

image commands (again)
        244243 by: Ron Piggott (PHP)
        244245 by: Google Kreme
        244246 by: Rasmus Lerdorf

Re: Frameworks
        244244 by: Bruce Cowin
        244247 by: John.H

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 ---
# [EMAIL PROTECTED] / 2006-11-05 15:13:19 +0200:
> I have a list of subjects, such as "Linux", "Open Source", and "the
> World Wide Web". The subjects are stored in a database and being
> retrieved via php. I currently organize them alphabetically with SQL's
> ORDER BY ASC argument, however, if there is a preceding "the " or "a "
> then that is considered as part of the alphabetical order. Thus, all
> the subjects starting with "the " are grouped together, as are the
> subjects starting with "a ". How can I order by ascending, without
> taking the preceding "the " or "a " into account?

> Current code:
> $query  = "SELECT subject FROM table ORDER BY subject asc";
> $result = mysql_query($query);

    If you used PostgreSQL I'd suggest a functional index and ordering
    on the function... Does MySQL have anything like this?

    CREATE FUNCTION fn(TEXT)
    RETURNS TEXT
    IMMUTABLE STRICT
    LANGUAGE SQL
    AS $$
      SELECT regexp_replace($1, '^(?:(?:a|the)[[:space:]]+)', '', 'i');
    $$;

    CREATE INDEX ON table(fn(subject));

    SELECT subject FROM table ORDER BY fn(subject) ASC;

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

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

Current code:
$query  = "SELECT subject FROM table ORDER BY subject asc";
$result = mysql_query($query);

I dont seen any php code to do any sorting,just a mysql query, perhaps a mysql list or maybe you should try doing it in php yourself first.

Not that I know the answer, but mysql does have a substring function, perhaps it can help.
--- End Message ---
--- Begin Message ---
How do you make .gdf files for use with imageloadfont ?  Ron

--- End Message ---
--- Begin Message ---
The important steps:

1. display the form on utf-8 page:
        header('Content-Type: text/html; codepage=utf-8');
        ... and the same in <meta> tag
2. use pg_set_client_encoding('UTF8') after connecting to posgres
3. have your database, tables and rows in UTF8 (you have already)
4. again, when retrieving, pg_set_client_encoding('UTF8')
5. display the form on utf-8 page

Alain Roger  wrote / napĂ­sal(a):
> Hi,
> 
> Sorry to cross post this mail but i'm not able to know from where comes my
> issue.
> I have a postgreSQL database in UNICODE (UTF-8 in v8.1.4 and UNICODE in
> v8.0.1).
> 
> Via my web application i type a sentence in Slovak language and it is
> stored
> into DB without any slovak characters. Instead of that, all particular
> characters are replace with \303\251 or \303\206 or \304\314 and so on...

perhaps the characters are stored as UTF-8, but you view them over ASCII
connection

> 
> I was thinking that issue was coming from DB encryption but on 2 different
> versions of DB (see above) i get the same result.
> after, i was thinking that it was coming from my web browser, but even if i
> setup character mode in central europe and Slovak language as default
> coding...nothing change...i tried on IE and Firefox.
> 
> Last step, i tried to type directly from my PhpPgAdmin (direct typing
> sentence there to DB), and i realize that when i click on save...the
> changes
> appear in DB aswritten above (e.g. : \303\251,...)
> 
> My latest test was to write via PhpPgAdmin (directly to DB) the UNICODE of
> slovak character contained within my sentence...so i used &#253, &#237 and
> so on...
> if i do that, those code are correctly saved into DB and when my PHP code
> show web pages, all sentences are correct.

these are html entities, they are different, they use only 7 bits. I
would not recomend on using them, you will use many capabilities.

--- End Message ---
--- Begin Message ---
I created a form that I have on my site --- it is at
http://www.actsministrieschristianevangelism.org/development_tools/textart/details.html

If I run this script it creates a graphic image of the text the user
typed in with the appropriate options selected

I would now like to have the image created to have some HTML around
it ... I would like to have some text above the image and following it.
How do I do this in PHP?  

I would like something like


----

Good morning

{text image}

Good night

---

As soon as I give the 

Content-type: image/

the browser expects only the image to output to the screen and no HTML

Ron

--- End Message ---
--- Begin Message ---
On 05 Nov 2006, at 15:31 , Ron Piggott (PHP) wrote:
Content-type: image/

the browser expects only the image to output to the screen and no HTML

As if should.

Save the image in a temporary location and then send html that include and <img ... /> tag


--
Though it's cold and lonely in the deep dark night I can see paradise by the dashboard light.
--- End Message ---
--- Begin Message ---
Google Kreme wrote:
> On 05 Nov 2006, at 15:31 , Ron Piggott (PHP) wrote:
>> Content-type: image/
>>
>> the browser expects only the image to output to the screen and no HTML
> 
> As if should.
> 
> Save the image in a temporary location and then send html that include
> and <img ... /> tag

You don't need to do that.  You can just call the PHP script directly
from the img tag.  Your only problem is how to pass the parameters.  You
obviously can't do a POST request from the img tag, so you either need
to pass the parameters as part of the url as in:

  <img src="image.php?text=foo&size=10" />

Or you use a cookie-based mechanism like a PHP session and refer to that
from the image.php script.

-Rasmus

--- End Message ---
--- Begin Message ---
Hi Tony,

On the installation instructions for Radicore, I see a lot of mention of Apache 
but no mention of IIS set up.  Does Radicore work on IIS?

Thanks.


Regards,

Bruce

>>> "Tony Marston" <[EMAIL PROTECTED]> 3/11/2006 11:10:12 p.m. >>>
It totally depends on what type of application you are writing, and what 
features you want "out of the box" so that you don't have to design and 
write them yourself.

For example, if you are writing an administrative web application and you 
want user authentication, dynamic menus, role based access control, audit 
logging without database triggers, built-in workflow, and 
internationalisation facilities then you might want to take a look at 
Radicore (http://www.radicore.org/)

As well as having all the above features it has a custom built Data 
Dictionary which can generate all the basic code for you. This enables you 
to start with nothing more than a database schema which you then import into 
the Data Dictionary, and from there you can press buttons to generate the 
database table classes and also buttons to generate the scripts to view and 
maintain those tables. All this without having to write a single line of 
code. It uses a catalog of transaction patterns which deal with single 
tables, one-to-many relationships and even many-to-many relationships.

There is a massive amount of documentation and sample code, and a tutorial 
is available at http://www.tonymarston.net/php-mysql/radicore-tutorial.html 


-- 
Tony Marston
http://www.tonymarston.net 
http://www.radicore.org 

<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I know this subject has been covered in the past, but my question is why
> use them?  I'm hoping to not create a religious war...  I see that
> frameworks would probably help you develop some things faster, but most
> of the time they don't do the things the way I would want them to work.
> If I did use one, it almost seems like I would use it to get through
> something  until I had time to do things the way I wanted/needed to do
> them.  There's a lot of talk about frameworks lately, and especially
> the Zend Framework, so I'd like to look into what it's all about.  I
> think I might be missing out the framework issue, so I'd like to hear
> other people's opinions.
>
> I do like the mail, pdf, and a few other parts of the Zend Framework.  I
> also like that it's more like a set of tools than a monolithic beast
> that would take a lot of memory just to load up into your application.
>
> Your thoughts?
>
> Thanks,
> Ray 

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

--- End Message ---
--- Begin Message ---
I have just watched the Code Igniter Video Tutorials and found thtat it is
very easy to make a MVC module by using this framework,and it is very
similar to the CMS I just developed.Also I still pay attention to other
framework,and I hope to find a framework that can be really helpful to my
work,but it is so many php framework to choose ,so I find it is to hard to
choose one .
Anyway you will find the framework is worth to use when you maintain your
project.


2006/11/6, Bruce Cowin <[EMAIL PROTECTED]>:

Hi Tony,

On the installation instructions for Radicore, I see a lot of mention of
Apache but no mention of IIS set up.  Does Radicore work on IIS?

Thanks.


Regards,

Bruce

>>> "Tony Marston" <[EMAIL PROTECTED]> 3/11/2006 11:10:12 p.m.
>>>
It totally depends on what type of application you are writing, and what
features you want "out of the box" so that you don't have to design and
write them yourself.

For example, if you are writing an administrative web application and you
want user authentication, dynamic menus, role based access control, audit
logging without database triggers, built-in workflow, and
internationalisation facilities then you might want to take a look at
Radicore (http://www.radicore.org/)

As well as having all the above features it has a custom built Data
Dictionary which can generate all the basic code for you. This enables you
to start with nothing more than a database schema which you then import
into
the Data Dictionary, and from there you can press buttons to generate the
database table classes and also buttons to generate the scripts to view
and
maintain those tables. All this without having to write a single line of
code. It uses a catalog of transaction patterns which deal with single
tables, one-to-many relationships and even many-to-many relationships.

There is a massive amount of documentation and sample code, and a tutorial
is available at
http://www.tonymarston.net/php-mysql/radicore-tutorial.html


--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

<[EMAIL PROTECTED]> wrote in message
news:
[EMAIL PROTECTED]
...
>I know this subject has been covered in the past, but my question is why
> use them?  I'm hoping to not create a religious war...  I see that
> frameworks would probably help you develop some things faster, but most
> of the time they don't do the things the way I would want them to work.
> If I did use one, it almost seems like I would use it to get through
> something  until I had time to do things the way I wanted/needed to do
> them.  There's a lot of talk about frameworks lately, and especially
> the Zend Framework, so I'd like to look into what it's all about.  I
> think I might be missing out the framework issue, so I'd like to hear
> other people's opinions.
>
> I do like the mail, pdf, and a few other parts of the Zend Framework.  I
> also like that it's more like a set of tools than a monolithic beast
> that would take a lot of memory just to load up into your application.
>
> Your thoughts?
>
> Thanks,
> Ray

--
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



--- End Message ---

Reply via email to