php-general Digest 20 Oct 2012 12:23:47 -0000 Issue 8015
Topics (messages 319521 through 319525):
Re: Table help needed
319521 by: admin
319522 by: tamouse mailing lists
User Timezone
319523 by: Karl DeSaulniers
319525 by: Maciek Sokolewicz
Missing email
319524 by: Karl DeSaulniers
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 ---
> -----Original Message-----
> From: Chris Payne [mailto:oxygene...@gmail.com]
> Sent: Friday, October 19, 2012 7:01 PM
> To: <php-gene...@lists.php.net>
> Subject: [PHP] Table help needed
>
> Hi everyone,
>
> So i'm stuck, and I admit it. I have to (QUICKLY) display information
> from a database, easy. But the formatting they want is in a HTML
> table, 3 columns at a time and unlimited rows - how can I display 3
> columns across at a time? Please help, it's a last minute thing !!!
>
> Chris
$query = "SELECT * TABLE";
$result = mysql_query($query);
If(mysql_num_rows($result) >= 1)
{
Echo "<table>";
While($row = mysql_fetch_assoc($result))
{
Echo
"<TR><TD>".$row[field1]."</TD><TD>".$row[field2]."</TD><TD>".$row[field3]."<
/TD></TR>
}
Echo "</table>";
}
--- End Message ---
--- Begin Message ---
On Fri, Oct 19, 2012 at 6:09 PM, admin <ad...@buskirkgraphics.com> wrote:
>> -----Original Message-----
>> From: Chris Payne [mailto:oxygene...@gmail.com]
>> Sent: Friday, October 19, 2012 7:01 PM
>> To: <php-gene...@lists.php.net>
>> Subject: [PHP] Table help needed
>>
>> Hi everyone,
>>
>> So i'm stuck, and I admit it. I have to (QUICKLY) display information
>> from a database, easy. But the formatting they want is in a HTML
>> table, 3 columns at a time and unlimited rows - how can I display 3
>> columns across at a time? Please help, it's a last minute thing !!!
>>
>> Chris
>
>
> $query = "SELECT * TABLE";
> $result = mysql_query($query);
> If(mysql_num_rows($result) >= 1)
> {
> Echo "<table>";
> While($row = mysql_fetch_assoc($result))
> {
> Echo
> "<TR><TD>".$row[field1]."</TD><TD>".$row[field2]."</TD><TD>".$row[field3]."<
> /TD></TR>
> }
> Echo "</table>";
> }
Surprised no one else has jumped on the "Don't use mysql anymore" thing here.
Quick and dirty PDO implementation: https://gist.github.com/3922192
--- End Message ---
--- Begin Message ---
Hello all,
Happy weekend. Hoping you can help me with an age old question.
I am trying to get a users timezone for a purchase online.
I know that php is not really able to get a timzone of a user because
its a server side execution with the date functions.
But I wanted to get a little help on my work around. I am hoping
someone can help. TIA
I have a form that a user must fill out in order to purchase anything.
On this form they are required to put their city, state, country and
zip code.
These are all required fields.
Now, I know there is a way to get a timezone offset if you have a
location to offset.
So is there a way based on the fields provided that I can get that
offset for each user?
(The users have to put a correct city, state, country and zip in order
to get there purchase.
This address has to match their paypal or cc address in order to
purchase as well.
So I know there will still be a margin of error with user manipulated
info. So that is moot point for now.)
My thoughts are to get a timezone offset based on the country and zip
code, with a backup check of city state country zip.
I just don't know where to start looking for how to get the timezone
or UTC location based on country and zip or city state country zip.
Any help is appreciated.
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com
--- End Message ---
--- Begin Message ---
On 20-10-2012 09:39, Karl DeSaulniers wrote:
Hello all,
Happy weekend. Hoping you can help me with an age old question.
I am trying to get a users timezone for a purchase online.
I know that php is not really able to get a timzone of a user because
its a server side execution with the date functions.
But I wanted to get a little help on my work around. I am hoping someone
can help. TIA
I have a form that a user must fill out in order to purchase anything.
On this form they are required to put their city, state, country and zip
code.
These are all required fields.
Now, I know there is a way to get a timezone offset if you have a
location to offset.
So is there a way based on the fields provided that I can get that
offset for each user?
(The users have to put a correct city, state, country and zip in order
to get there purchase.
This address has to match their paypal or cc address in order to
purchase as well.
So I know there will still be a margin of error with user manipulated
info. So that is moot point for now.)
My thoughts are to get a timezone offset based on the country and zip
code, with a backup check of city state country zip.
I just don't know where to start looking for how to get the timezone or
UTC location based on country and zip or city state country zip.
Hi Karl,
so basically what you're looking for is a database map between timezone
and country/state/zip.
Did you try to google such a thing?
One of the first posts I found was a StackOverflow question about this;
one of the answers mentioned just such a database on Tom Boutell's
website (the same person who created the GD library [used for
image-creation in php]): http://www.boutell.com/zipcodes/
It includes states, cities, zip codes, etc. for the USA. Since you
specifically mentioned you want to find it "by state", it means you're
mainly focussing on the USA (barely any other country even bothers with
states).
Apart from the above data, I'm sure you can find more on google.
Good luck.
- Tul
--- End Message ---
--- Begin Message ---
@Moderator
Any reason why my emails do not post or at least dont post for hours
later?
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com
--- End Message ---