RE: [PHP] Timestamp math and format

2001-10-19 Thread Alfredeen Johan K
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, I format it like this SELECT DATE_FORMAT

[PHP] MySQL tables are read-only

2001-10-04 Thread Alfredeen, Johan
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

RE: [PHP] PHP MySQL

2001-10-02 Thread Alfredeen, Johan
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

RE: [PHP] Variable naming

2001-09-25 Thread Alfredeen, Johan
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;

RE: [PHP] Assign multiple variables from mysql_fetch_row() call

2001-09-04 Thread Alfredeen, Johan
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($result));

[PHP] PHP Security

2001-08-31 Thread Alfredeen, Johan
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

RE: [PHP] PHP Security

2001-08-31 Thread Alfredeen, Johan
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 had

RE: [PHP] array search

2001-08-31 Thread Alfredeen, Johan
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

RE: [PHP] RE: [PHP-WIN] Can PHP and Java work together?

2001-08-31 Thread Alfredeen, Johan
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. Johan

RE: [PHP] Can PHP and Java work together?

2001-08-31 Thread Alfredeen, Johan
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:

RE: [PHP] php query for mysql table

2001-08-20 Thread Alfredeen, Johan
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

RE: [PHP] Adding records to a MySql database

2001-08-20 Thread Alfredeen, Johan
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 ...

RE: [PHP] Adding records to a MySql database

2001-08-20 Thread Alfredeen, Johan
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

[PHP] Zend Optimizer

2001-08-16 Thread Alfredeen, Johan
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

RE: [PHP] insertion question

2001-08-15 Thread Alfredeen, Johan
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

RE: [PHP] weird array behaviour

2001-08-15 Thread Alfredeen, Johan
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 could

RE: [PHP] Select

2001-08-14 Thread Alfredeen, Johan
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 {

RE: [PHP] Looking for link system

2001-08-14 Thread Alfredeen, Johan
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

RE: [PHP] selecting words

2001-08-07 Thread Alfredeen, Johan
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:

RE: [PHP] Splitting Text

2001-08-06 Thread Alfredeen, Johan
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