Thanks, That was just what I needed, ie:
SELECT DATE_FORMAT(DATE_SUB(insert_date, INTERVAL 2 HOUR), '%b %e (%r)')
Johan
> On 17-Oct-2001 Alfredeen Johan K wrote:
> > I store a timestamp in a database of when a record was
> inserted. When I pull
> > it out,
My webhost recently migrated my site over to a new server and IP. Everything
looks ok, except that all my MySQL tables now are read-only (at least that's
the error I get when trying to delete or insert records). How do I change
the tables back to write? Can I switch individual tables to write or i
I'm a little confused over why you would display the same flavor more than
once for a single item. But ok. Have you thought about populating an array
with the flavors and then retrieving flavors from the array however many
times you need to in an if statement. Maybe it would be easier to comment i
Read this
http://www.php.net/manual/en/language.variables.variable.php
Johan
www.pongworld.com
php tt
-Original Message-
From: Fábio Migliorini [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 12:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable naming
$id = 1;
$s
You can use a while loop. Ie: (where $row is the result of a sql query)
if ($row = mysql_fetch_array($result)) {
do {
$var1 = $row["column1"];
$var2 = $row["column2"];
$var2 = $row["column3"];
} while ($row = mysql_fetch_array($resu
Joseph,
The below postings are what you're looking for. Hopefully the in_array PHP
function uses a smart search algorithm and doesn't go through the entire
array. If you store your values in a db you can make use of an index on the
column, or you could write your own search algorithm that uses a
Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 9:57 AM
To: Alfredeen, Johan; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP Security
Great question - I'd love to know too.
I can give you one hint. Make sure that you validate any variables passed
in the url. I
Jack,
My apologies. Disregard my earlier example - it only works because the PHP
variable is "passed" to the javascript variable during onLoad when
everything is executed. But in your case, the page has already been sent to
the client and PHP can only be called by calling the server again.
Joha
I am looking for a good, practical tutorial on what I should be doing as a
developer to create a secure web site (PHP related). I have looked in my PHP
text and searched the web, but haven't found anything real useful. I am not
interested in Apache or OS security, as this is -hopefully- taken care
Jack,
Yes this is possible. I assume you want to use a javascript onClick event
function. Then in your javasript code, just execute your PHP code. You can
run PHP code within a javascript block. For example, on my site I assign a
javascript variable to the value held in a PHP variable like this:
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
VALUES (expression,...),(...),...
or INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
SELECT ...
or INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name
Read in the mySQL manual at
/mysql_manual_split/manual-split/manual_Reference.html#CREATE_TABLE
etc
ie.
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)]
[table_options] [select_statement]
ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...]
and more ...
Joha
Wolfgang,
Use LIKE '%life%' as in
SELECT somecolumn FROM mytable WHERE LOWER(mycolumn) LIKE '%life%'
Don't forget to compare same case strings.
Johan Alfredeen
www.pongworld.com
>From mySQL manual:
mysql> SELECT * FROM tbl_name WHERE set_col LIKE '%value%';
mysql> SELECT * FROM tbl_name WHERE
This is actually not so difficult. Just download the mySQL documentation
(from mysql.org or .com I believe is where I got it) and search the function
list.
Johan Alfredeen
-Original Message-
From: Tom Carter [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 19, 2001 8:53 AM
To: Chris Lamb
Ok, I've searched the archives and even contacted the Zend staff on this
one, and I'm still confused. I also posted this question at the Zend
Optimizer Forum but have not received an answer. I'm hoping one of you has
some idea of how the Zend Optimizer works and can explain it. My webhost
offers P
Nick,
I also have noticed "weird" behavior with multi (or 2D) arrays. Read more
on the manual board about arrays. However, I have finally figured out
something that works. Be careful of you you define the subarray, assign
values, and read the array. Here's what works for me:
Creating: (you coul
My experience, at least from Oracle and SQLServer, is that very large tables
(many millions of records) is not really a problem as long as you design and
index well. Where you'll run into problems is when you try to join 2 very
large tables together on the fly. This is where you'll need to do prej
Search
http://sourceforge.net/ and
http://freshmeat.net/
Good luck,
Johan Alfredeen
PongWorld.com
-Original Message-
From: Thomas Deliduka [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 14, 2001 9:20 AM
To: PHP List
Subject: [PHP] Looking for link system
I'm looking for a yahoo-s
Jeremy,
The reason you are only getting the first value is because you are only
retrieving the first value and assigning it to $data. You need to step
through the result and do something with it. For example,
if ($row = mysql_fetch_array($result)) {
do {
Jamie,
There was a post earlier very similar to this. If you have a database, you
could use SELECT LEFT(mycolumn, 100) FROM mytable WHERE ...
Without a db, you can use the PHP substring function:
substr()
Hope this helps,
Johan Alfredeen
www.pongworld.com
-Original Message-
From: J
Jord,
I would accomplish this through SQL. You could use SELECT LEFT(mycolumn,x)
FROM mytable WHERE ...
and then display that along with a link to a page where you select the whole
string on that particular article ID. In fact, I do this exact thing on my
site.
Or you could read the whole strin
21 matches
Mail list logo